2 # uCsim s51.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
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
26 SHAREDLIB = @SHAREDLIB@
29 SDCFLAGS = --debug --stack-after-data --model-small
32 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lsim -lcmd -lguiucsim
37 exec_prefix = @exec_prefix@
41 includedir = @includedir@
43 man1dir = $(mandir)/man1
44 man2dir = $(mandir)/man2
48 OBJECTS_SHARED = glob.o sim51.o \
49 inc.o jmp.o mov.o logic.o arith.o bit.o \
50 timer0.o timer1.o timer2.o serial.o port.o interrupt.o \
52 uc51.o uc52.o uc51r.o uc89c51r.o uc251.o \
55 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
57 enable_dlso = @enable_dlso@
61 # Compiling entire program or any subproject
62 # ------------------------------------------
63 all: checkconf otherlibs s51.src
66 # Compiling and installing everything and runing test
67 # ---------------------------------------------------
68 install: all installdirs
69 if test -f s51.exe; then $(INSTALL) -s s51.exe $(bindir); $(STRIP) $(bindir)/s51.exe; fi
70 if test -f s51; then $(INSTALL) -s s51 $(bindir); $(STRIP) $(bindir)/s51; fi
73 # Deleting all the installed files
74 # --------------------------------
79 # Performing self-test
80 # --------------------
85 test_ser.ihx: test_ser.rel
86 $(SDCC) $(SDCFLAGS) $<
88 # Performing installation test
89 # ----------------------------
93 # Creating installation directories
94 # ---------------------------------
96 test -d $(bindir) || $(INSTALL) -d $(bindir)
99 # Creating dependencies
100 # ---------------------
103 Makefile.dep: *.cc *.h
104 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
117 s51.src: s51 shared_lib
119 s51: $(OBJECTS) $(PRJDIR)/*.a
120 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o s51
122 ifeq ($(dlso_ok),yes)
123 shared_lib: $(PRJDIR)/s51.so
126 @$(PRJDIR)/mkecho $(PRJDIR) "No 51 shared lib made."
127 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
130 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
131 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/s51.so
134 cd $(PRJDIR)/cmd.src && $(MAKE) all
135 cd $(PRJDIR)/sim.src && $(MAKE) all
136 $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
139 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
142 $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
145 # Remaking configuration
146 # ----------------------
148 @if [ -f $(PRJDIR)/devel ]; then\
149 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
152 # End of s51.src/Makefile.in