* src/SDCCpeeph.c (peepHole): Fixed all leaks. Added trace support for freeing...
[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 -lcmd -lguiucsim -lutil
33 DL              = @DL@
34
35 dl_ok           = @dl_ok@
36
37 prefix          = @prefix@
38 exec_prefix     = @exec_prefix@
39 bindir          = @bindir@
40 libdir          = @libdir@
41 datadir         = @datadir@
42 includedir      = @includedir@
43 mandir          = @mandir@
44 man1dir         = $(mandir)/man1
45 man2dir         = $(mandir)/man2
46 infodir         = @infodir@
47 srcdir          = @srcdir@
48
49 OBJECTS_SHARED  = glob.o sim51.o \
50                   inc.o jmp.o mov.o logic.o arith.o bit.o \
51                   timer0.o timer1.o timer2.o serial.o port.o interrupt.o \
52                   uc51.o uc52.o uc51r.o uc89c51r.o uc251.o uc390.o
53 OBJECTS_EXE     = s51.o 
54 OBJECTS         = $(OBJECTS_SHARED) $(OBJECTS_EXE)
55
56
57 # Compiling entire program or any subproject
58 # ------------------------------------------
59 all: checkconf otherlibs s51.src
60
61 tests: test_ser.ihx
62
63 test_ser.ihx: test_ser.rel
64         $(SDCC) $(SDCFLAGS) $<
65
66
67 # Compiling and installing everything and runing test
68 # ---------------------------------------------------
69 install: all installdirs
70         if test -f s51.exe; then $(INSTALL) s51.exe $(bindir); $(STRIP) $(bindir)/s51.exe; fi
71         if test -f s51; then $(INSTALL) s51 $(bindir); $(STRIP) $(bindir)/s51; fi
72
73
74 # Deleting all the installed files
75 # --------------------------------
76 uninstall:
77         rm -f $(bindir)/s51
78
79
80 # Performing self-test
81 # --------------------
82 check:
83
84
85 # Performing installation test
86 # ----------------------------
87 installcheck:
88
89
90 # Creating installation directories
91 # ---------------------------------
92 installdirs:
93         test -d $(bindir) || $(INSTALL) -d $(bindir)
94
95
96 # Creating dependencies
97 # ---------------------
98 dep: Makefile.dep
99
100 Makefile.dep: *.cc *.h
101         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
102
103 include Makefile.dep
104 include clean.mk
105
106 #parser.cc: parser.y
107
108 #plex.cc: plex.l
109
110 # My rules
111 # --------
112 .SUFFIXES: .rel
113
114 s51.src: s51 shared_lib
115
116 s51: $(OBJECTS) $(PRJDIR)/*.a
117         $(CXX) $(CXXFLAGS) -o s51 $(OBJECTS) $(LIBS)
118
119 ifeq ($(SHAREDLIB),yes)
120 shared_lib: $(PRJDIR)/s51.so
121 else
122 shared_lib:
123         @echo "No shared lib made."
124 endif
125
126 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
127         $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/s51.so
128
129 otherlibs:
130         cd $(PRJDIR)/cmd.src && $(MAKE) all
131         cd $(PRJDIR)/sim.src && $(MAKE) all
132         $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
133
134 .cc.o:
135         $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
136
137 .c.rel:
138         $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
139
140
141 # Remaking configuration
142 # ----------------------
143 checkconf:
144         @if [ -f $(PRJDIR)/devel ]; then\
145           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
146         fi
147
148 # End of s51.src/Makefile.in