* sim/ucsim/gui.src/serio.src/Makefile.in, sim/ucsim/s51.src/Makefile.in, sim/ucsim...
[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) s51$(EXEEXT) $(DESTDIR)$(bindir)/s51$(EXEEXT)
72         $(STRIP) $(DESTDIR)$(bindir)/s51$(EXEEXT)
73
74
75 # Deleting all the installed files
76 # --------------------------------
77 uninstall:
78         rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
79
80
81 # Performing self-test
82 # --------------------
83 check: test
84
85 test: test_ser.ihx
86
87 test_ser.ihx: test_ser.rel
88         $(SDCC) $(SDCFLAGS) $<
89
90 # Performing installation test
91 # ----------------------------
92 installcheck:
93
94
95 # Creating installation directories
96 # ---------------------------------
97 installdirs:
98         test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
99
100
101 # Creating dependencies
102 # ---------------------
103 dep: Makefile.dep
104
105 Makefile.dep: *.cc *.h
106         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
107
108 include Makefile.dep
109 include clean.mk
110
111 #parser.cc: parser.y
112
113 #plex.cc: plex.l
114
115 # My rules
116 # --------
117 .SUFFIXES: .rel
118
119 s51.src: s51$(EXEEXT) shared_lib
120
121 s51$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
122         $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
123
124 ifeq ($(dlso_ok),yes)
125 shared_lib: $(PRJDIR)/s51.so
126 else
127 shared_lib:
128         @$(PRJDIR)/mkecho $(PRJDIR) "No 51 shared lib made."
129         @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
130 endif
131
132 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
133         $(CXX) -shared $(OBJECTS_SHARED) -o $@
134
135 otherlibs:
136         cd $(PRJDIR) && $(MAKE) libs
137         cd $(PRJDIR)/cmd.src && $(MAKE) all
138         cd $(PRJDIR)/sim.src && $(MAKE) all
139         $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
140
141 .cc.o:
142         $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
143
144 .c.rel:
145         $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
146
147
148 # Remaking configuration
149 # ----------------------
150 checkconf:
151         @if [ -f $(PRJDIR)/devel ]; then\
152           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
153         fi
154
155 # End of s51.src/Makefile.in