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 -lcmd -lguiucsim -lutil
38 exec_prefix = @exec_prefix@
42 includedir = @includedir@
44 man1dir = $(mandir)/man1
45 man2dir = $(mandir)/man2
49 OBJECTS_SHARED = glob.o sim51.o \
50 inc.o jmp.o mov.o logic.o arith.o bit.o \
51 timer0.o timer1.o timer2.o serial.o port.o interrupt.o \
52 uc51.o uc52.o uc51r.o uc89c51r.o uc251.o uc390.o
54 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
57 # Compiling entire program or any subproject
58 # ------------------------------------------
59 all: checkconf otherlibs s51.src
63 test_ser.ihx: test_ser.rel
64 $(SDCC) $(SDCFLAGS) $<
67 # Compiling and installing everything and runing test
68 # ---------------------------------------------------
69 install: all installdirs
70 if test -f s51.exe; then $(INSTALL) s51.exe $(bindir); $(STRIP) $(bindir)/s51.exe; fi
71 if test -f s51; then $(INSTALL) s51 $(bindir); $(STRIP) $(bindir)/s51; fi
74 # Deleting all the installed files
75 # --------------------------------
80 # Performing self-test
81 # --------------------
85 # Performing installation test
86 # ----------------------------
90 # Creating installation directories
91 # ---------------------------------
93 test -d $(bindir) || $(INSTALL) -d $(bindir)
96 # Creating dependencies
97 # ---------------------
100 Makefile.dep: *.cc *.h
101 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
114 s51.src: s51 shared_lib
116 s51: $(OBJECTS) $(PRJDIR)/*.a
117 $(CXX) $(CXXFLAGS) -o s51 $(OBJECTS) $(LIBS)
119 ifeq ($(SHAREDLIB),yes)
120 shared_lib: $(PRJDIR)/s51.so
123 @echo "No shared lib made."
126 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
127 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/s51.so
130 cd $(PRJDIR)/cmd.src && $(MAKE) all
131 cd $(PRJDIR)/sim.src && $(MAKE) all
132 $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
135 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
138 $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
141 # Remaking configuration
142 # ----------------------
144 @if [ -f $(PRJDIR)/devel ]; then\
145 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
148 # End of s51.src/Makefile.in