2 # uCsim s51.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
18 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
19 CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) \
20 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
21 CFLAGS = @CFLAGS@ -Wall
22 CXXFLAGS = @CXXFLAGS@ -Wall
25 SHAREDLIB = @SHAREDLIB@
28 SDCFLAGS = --debug --stack-after-data --model-small
31 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lcmd -lguiucsim -lutil
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 \
51 uc51.o uc52.o uc51r.o uc89c51r.o uc251.o uc390.o
53 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
56 # Compiling entire program or any subproject
57 # ------------------------------------------
58 all: checkconf otherlibs s51.src
62 test_ser.ihx: test_ser.rel
63 $(SDCC) $(SDCFLAGS) $<
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);fi
70 if test -f s51; then $(INSTALL) -s s51 $(bindir);fi
73 # Deleting all the installed files
74 # --------------------------------
79 # Performing self-test
80 # --------------------
84 # Performing installation test
85 # ----------------------------
89 # Creating installation directories
90 # ---------------------------------
92 test -d $(bindir) || $(INSTALL) -d $(bindir)
95 # Creating dependencies
96 # ---------------------
99 Makefile.dep: *.cc *.h
100 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
113 s51.src: s51 shared_lib
115 s51: $(OBJECTS) $(PRJDIR)/*.a
116 $(CXX) $(CXXFLAGS) -o s51 $(OBJECTS) $(LIBS)
118 ifeq ($(SHAREDLIB),yes)
119 shared_lib: $(PRJDIR)/s51.so
122 @echo "No shared lib made."
125 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
126 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/s51.so
129 cd $(PRJDIR)/cmd.src && $(MAKE) all
130 cd $(PRJDIR)/sim.src && $(MAKE) all
131 $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
134 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
137 $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
140 # Remaking configuration
141 # ----------------------
143 @if [ -f $(PRJDIR)/devel ]; then\
144 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
147 # End of s51.src/Makefile.in