2 # uCsim z80.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 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
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) sz80$(EXEEXT) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
76 $(STRIP) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
79 # Deleting all the installed files
80 # --------------------------------
82 rm -f $(DESTDIR)$(bindir)/sz80$(EXEEXT)
85 # Performing self-test
86 # --------------------
92 # Performing installation test
93 # ----------------------------
97 # Creating installation directories
98 # ---------------------------------
100 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
103 # Creating dependencies
104 # ---------------------
107 Makefile.dep: *.cc *.h
108 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
117 z80.src: sz80$(EXEEXT) shared_lib
119 sz80$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
120 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
122 ifeq ($(dlso_ok),yes)
123 shared_lib: $(PRJDIR)/sz80.so
126 @$(PRJDIR)/mkecho $(PRJDIR) "No z80 shared lib made."
127 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
130 $(PRJDIR)/sz80.so: $(OBJECTS_SHARED)
131 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/sz80.so
134 cd $(PRJDIR)/cmd.src && $(MAKE) all
135 cd $(PRJDIR)/sim.src && $(MAKE) all
138 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
141 $(Z80ASM) -l $< -o $@ -e $<.lst
144 # Remaking configuration
145 # ----------------------
147 @if [ -f $(PRJDIR)/devel ]; then\
148 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
151 # End of z80.src/Makefile.in