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
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 \
54 uc51.o uc52.o uc51r.o uc89c51r.o uc251.o \
57 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
59 enable_dlso = @enable_dlso@
63 # Compiling entire program or any subproject
64 # ------------------------------------------
65 all: checkconf otherlibs s51.src
68 # Compiling and installing everything and runing test
69 # ---------------------------------------------------
70 install: all installdirs
71 $(INSTALL) -s s51$(EXEEXT) $(bindir)
74 # Deleting all the installed files
75 # --------------------------------
77 rm -f $(bindir)/s51$(EXEEXT)
80 # Performing self-test
81 # --------------------
86 test_ser.ihx: test_ser.rel
87 $(SDCC) $(SDCFLAGS) $<
89 # Performing installation test
90 # ----------------------------
94 # Creating installation directories
95 # ---------------------------------
97 test -d $(bindir) || $(INSTALL) -d $(bindir)
100 # Creating dependencies
101 # ---------------------
104 Makefile.dep: *.cc *.h
105 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
118 s51.src: s51$(EXEEXT) shared_lib
120 s51$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
121 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
123 ifeq ($(dlso_ok),yes)
124 shared_lib: $(PRJDIR)/s51.so
127 @$(PRJDIR)/mkecho $(PRJDIR) "No 51 shared lib made."
128 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
131 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
132 $(CXX) -shared $(OBJECTS_SHARED) -o $@
135 cd $(PRJDIR)/cmd.src && $(MAKE) all
136 cd $(PRJDIR)/sim.src && $(MAKE) all
137 $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
140 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
143 $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
146 # Remaking configuration
147 # ----------------------
149 @if [ -f $(PRJDIR)/devel ]; then\
150 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
153 # End of s51.src/Makefile.in