621ec875b5494a785f9215eece95f0ce46313c2f
[fw/sdcc] / sim / ucsim / s51.src / Makefile.in
1 #
2 # uCsim s51.src/Makefile
3 #
4 # (c) Drotos Daniel, Talker Bt. 1997
5 #
6
7 STARTYEAR       = 1997
8
9 SHELL           = /bin/sh
10 CXX             = @CXX@
11 CPP             = @CPP@
12 CXXCPP          = @CXXCPP@
13 RANLIB          = @RANLIB@
14 INSTALL         = @INSTALL@
15 STRIP           = @STRIP@
16
17 PRJDIR          = ..
18
19 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
20 CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
21                   -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
22 CFLAGS          = @CFLAGS@ -Wall
23 CXXFLAGS        = @CXXFLAGS@ -Wall
24 M_OR_MM         = @M_OR_MM@
25 PICOPT          = @PICOPT@
26 SHAREDLIB       = @SHAREDLIB@
27
28 SDCC            = sdcc
29 SDCFLAGS        = --debug --stack-after-data --model-small
30 SDCPPFLAGS      = 
31
32 LIBS            = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
33 DL              = @DL@
34 dl_ok           = @dl_ok@
35
36 prefix          = @prefix@
37 exec_prefix     = @exec_prefix@
38 bindir          = @bindir@
39 libdir          = @libdir@
40 datadir         = @datadir@
41 includedir      = @includedir@
42 mandir          = @mandir@
43 man1dir         = $(mandir)/man1
44 man2dir         = $(mandir)/man2
45 infodir         = @infodir@
46 srcdir          = @srcdir@
47
48 EXEEXT          = @EXEEXT@
49
50 OBJECTS_SHARED  = glob.o sim51.o \
51                   inc.o jmp.o mov.o logic.o arith.o bit.o \
52                   timer0.o timer1.o timer2.o serial.o port.o interrupt.o \
53                   wdt.o pca.o \
54                   uc51.o uc52.o uc51r.o uc89c51r.o uc251.o \
55                   uc390.o uc390hw.o
56 OBJECTS_EXE     = s51.o 
57 OBJECTS         = $(OBJECTS_SHARED) $(OBJECTS_EXE)
58
59 enable_dlso     = @enable_dlso@
60 dlso_ok         = @dlso_ok@
61
62
63 # Compiling entire program or any subproject
64 # ------------------------------------------
65 all: checkconf otherlibs s51.src
66
67
68 # Compiling and installing everything and runing test
69 # ---------------------------------------------------
70 install: all installdirs
71         $(INSTALL) -s s51$(EXEEXT) $(DESTDIR)$(bindir)
72
73
74 # Deleting all the installed files
75 # --------------------------------
76 uninstall:
77         rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
78
79
80 # Performing self-test
81 # --------------------
82 check: test
83
84 test: test_ser.ihx
85
86 test_ser.ihx: test_ser.rel
87         $(SDCC) $(SDCFLAGS) $<
88
89 # Performing installation test
90 # ----------------------------
91 installcheck:
92
93
94 # Creating installation directories
95 # ---------------------------------
96 installdirs:
97         test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
98
99
100 # Creating dependencies
101 # ---------------------
102 dep: Makefile.dep
103
104 Makefile.dep: *.cc *.h
105         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
106
107 include Makefile.dep
108 include clean.mk
109
110 #parser.cc: parser.y
111
112 #plex.cc: plex.l
113
114 # My rules
115 # --------
116 .SUFFIXES: .rel
117
118 s51.src: s51$(EXEEXT) shared_lib
119
120 s51$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
121         $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
122
123 ifeq ($(dlso_ok),yes)
124 shared_lib: $(PRJDIR)/s51.so
125 else
126 shared_lib:
127         @$(PRJDIR)/mkecho $(PRJDIR) "No 51 shared lib made."
128         @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
129 endif
130
131 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
132         $(CXX) -shared $(OBJECTS_SHARED) -o $@
133
134 otherlibs:
135         cd $(PRJDIR) && $(MAKE) libs
136         cd $(PRJDIR)/cmd.src && $(MAKE) all
137         cd $(PRJDIR)/sim.src && $(MAKE) all
138         $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
139
140 .cc.o:
141         $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
142
143 .c.rel:
144         $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
145
146
147 # Remaking configuration
148 # ----------------------
149 checkconf:
150         @if [ -f $(PRJDIR)/devel ]; then\
151           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
152         fi
153
154 # End of s51.src/Makefile.in