2 # uCsim z80.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
17 top_builddir = @top_builddir@
18 top_srcdir = @top_srcdir@
20 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
21 CPPFLAGS = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
22 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
23 -I$(top_srcdir)/gui.src
24 CFLAGS = @CFLAGS@ -Wall
25 CXXFLAGS = @CXXFLAGS@ -Wall
28 SHAREDLIB = @SHAREDLIB@
31 LIBS = -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim @LIBS@
36 exec_prefix = @exec_prefix@
40 datarootdir = @datarootdir@
41 includedir = @includedir@
43 man1dir = $(mandir)/man1
44 man2dir = $(mandir)/man2
49 OBJECTS_SHARED = glob.o \
59 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
63 enable_dlso = @enable_dlso@
66 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
69 # Compiling entire program or any subproject
70 # ------------------------------------------
71 all: checkconf otherlibs z80.src tests
76 # Compiling and installing everything and runing test
77 # ---------------------------------------------------
78 install: all installdirs
79 $(INSTALL) sz80$(EXEEXT) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
80 $(STRIP) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
83 # Deleting all the installed files
84 # --------------------------------
86 rm -f $(DESTDIR)$(bindir)/sz80$(EXEEXT)
89 # Performing self-test
90 # --------------------
96 # Performing installation test
97 # ----------------------------
101 # Creating installation directories
102 # ---------------------------------
104 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
107 # Creating dependencies
108 # ---------------------
111 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
112 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
115 include $(srcdir)/clean.mk
121 z80.src: sz80$(EXEEXT) shared_lib
123 sz80$(EXEEXT): $(OBJECTS) $(top_builddir)/*.a
124 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
126 ifeq ($(dlso_ok),yes)
127 shared_lib: $(top_builddir)/sz80.so
130 @$(top_srcdir)/mkecho $(top_builddir) "No z80 shared lib made."
131 @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
134 $(top_builddir)/sz80.so: $(OBJECTS_SHARED)
135 $(CXX) -shared $(OBJECTS_SHARED) -o $(top_builddir)/sz80.so
138 $(MAKE) -C $(top_builddir)/cmd.src all
139 $(MAKE) -C $(top_builddir)/sim.src all
142 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
145 $(Z80ASM) -l $< -o $@ -e $<.lst
148 # Remaking configuration
149 # ----------------------
151 @if [ -f $(top_builddir)/devel ]; then\
152 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
155 # End of z80.src/Makefile.in