2 # uCsim z80.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@
27 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lcmd -lutil -lguiucsim
32 exec_prefix = @exec_prefix@
36 includedir = @includedir@
38 man1dir = $(mandir)/man1
39 man2dir = $(mandir)/man2
43 OBJECTS_SHARED = glob.o \
53 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
57 enable_dlso = @enable_dlso@
60 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
63 # Compiling entire program or any subproject
64 # ------------------------------------------
65 all: checkconf otherlibs z80.src tests
70 # Compiling and installing everything and runing test
71 # ---------------------------------------------------
72 install: all installdirs
73 $(INSTALL) -s sz80 $(bindir)
76 # Deleting all the installed files
77 # --------------------------------
82 # Performing self-test
83 # --------------------
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
114 z80.src: sz80 shared_lib
116 sz80: $(OBJECTS) $(PRJDIR)/*.a
117 $(CXX) $(CXXFLAGS) -o sz80 $(OBJECTS) $(LIBS)
119 ifeq ($(dlso_ok),yes)
120 shared_lib: $(PRJDIR)/sz80.so
123 @echo "No z80 shared lib made."
124 @echo "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
127 $(PRJDIR)/sz80.so: $(OBJECTS_SHARED)
128 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/sz80.so
131 cd $(PRJDIR)/cmd.src && $(MAKE) all
132 cd $(PRJDIR)/sim.src && $(MAKE) all
135 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
138 $(Z80ASM) -l $< -o $@ -e $<.lst
141 # Remaking configuration
142 # ----------------------
144 @if [ -f $(PRJDIR)/devel ]; then\
145 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
148 # End of z80.src/Makefile.in