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@
29 LIBS = @LIBS@ -L$(PRJDIR) -lutil -lsim -lutil -lcmd -lguiucsim
34 exec_prefix = @exec_prefix@
38 includedir = @includedir@
40 man1dir = $(mandir)/man1
41 man2dir = $(mandir)/man2
45 OBJECTS_SHARED = glob.o \
55 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
59 enable_dlso = @enable_dlso@
62 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
65 # Compiling entire program or any subproject
66 # ------------------------------------------
67 all: checkconf otherlibs z80.src tests
72 # Compiling and installing everything and runing test
73 # ---------------------------------------------------
74 install: all installdirs
75 $(INSTALL) -s sz80$(EXEEXT) $(bindir)
78 # Deleting all the installed files
79 # --------------------------------
81 rm -f $(bindir)/sz80$(EXEEXT)
84 # Performing self-test
85 # --------------------
91 # Performing installation test
92 # ----------------------------
96 # Creating installation directories
97 # ---------------------------------
99 test -d $(bindir) || $(INSTALL) -d $(bindir)
102 # Creating dependencies
103 # ---------------------
106 Makefile.dep: *.cc *.h
107 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
116 z80.src: sz80$(EXEEXT) shared_lib
118 sz80$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
119 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
121 ifeq ($(dlso_ok),yes)
122 shared_lib: $(PRJDIR)/sz80.so
125 @$(PRJDIR)/mkecho $(PRJDIR) "No z80 shared lib made."
126 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
129 $(PRJDIR)/sz80.so: $(OBJECTS_SHARED)
130 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/sz80.so
133 cd $(PRJDIR)/cmd.src && $(MAKE) all
134 cd $(PRJDIR)/sim.src && $(MAKE) all
137 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
140 $(Z80ASM) -l $< -o $@ -e $<.lst
143 # Remaking configuration
144 # ----------------------
146 @if [ -f $(PRJDIR)/devel ]; then\
147 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
150 # End of z80.src/Makefile.in