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 -lguiucsim -lcmd -lsim
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) s51$(EXEEXT) $(DESTDIR)$(bindir)/s51$(EXEEXT)
72 $(STRIP) $(DESTDIR)$(bindir)/s51$(EXEEXT)
75 # Deleting all the installed files
76 # --------------------------------
78 rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
81 # Performing self-test
82 # --------------------
87 test_ser.ihx: test_ser.rel
88 $(SDCC) $(SDCFLAGS) $<
90 # Performing installation test
91 # ----------------------------
95 # Creating installation directories
96 # ---------------------------------
98 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
101 # Creating dependencies
102 # ---------------------
105 Makefile.dep: *.cc *.h
106 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
119 s51.src: s51$(EXEEXT) shared_lib
121 s51$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
122 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
124 ifeq ($(dlso_ok),yes)
125 shared_lib: $(PRJDIR)/s51.so
128 @$(PRJDIR)/mkecho $(PRJDIR) "No 51 shared lib made."
129 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
132 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
133 $(CXX) -shared $(OBJECTS_SHARED) -o $@
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
142 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
145 $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
148 # Remaking configuration
149 # ----------------------
151 @if [ -f $(PRJDIR)/devel ]; then\
152 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
155 # End of s51.src/Makefile.in