2 # uCsim z80.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
21 top_builddir
= @top_builddir@
22 top_srcdir
= @top_srcdir@
24 transform
= @program_transform_name@
26 DEFS
= $(subs
-DHAVE_CONFIG_H
,,@DEFS@
)
27 CPPFLAGS
= @CPPFLAGS@
-I
$(srcdir) -I
$(top_srcdir
) -I
$(top_builddir
) \
28 -I
$(top_srcdir
)/cmd.src
-I
$(top_srcdir
)/sim.src \
29 -I
$(top_srcdir
)/gui.src
30 CFLAGS
= @WALL_FLAG@ @CFLAGS@
31 CXXFLAGS
= @WALL_FLAG@ @CXXFLAGS@
34 SHAREDLIB
= @SHAREDLIB@
37 LIBS
= -L
$(top_builddir
) -lsim
-lucsimutil
-lguiucsim
-lcmd
-lsim @LIBS@
42 exec_prefix = @
exec_prefix@
46 datarootdir
= @datarootdir@
47 includedir = @
includedir@
49 man1dir = $(mandir)/man1
50 man2dir = $(mandir)/man2
55 OBJECTS_SHARED
= glob.o \
63 glob_gb80.o inst_gb80.o gb80.o lr35902.o r800.o \
64 sim
$(TN
).o
$(TN
).o e
$(TN
).o
65 OBJECTS_EXE
= s
$(TN
).o
66 OBJECTS
= $(OBJECTS_SHARED
) $(OBJECTS_EXE
)
68 # short/long exe and lib name
70 LEN
= ucsim_
$(TN
)$(EXEEXT
)
71 SONAME
= libucsim_
$(TN
).so
73 enable_dlso
= @enable_dlso@
77 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
80 # Compiling entire program or any subproject
81 # ------------------------------------------
82 all: checkconf otherlibs
$(TN
).src tests
87 # Compiling and installing everything and running test
88 # ---------------------------------------------------
89 install: all installdirs install_shared_lib
90 $(INSTALL
) $(LEN
) $(DESTDIR
)$(bindir)/$(LEN
)
91 $(STRIP
) $(DESTDIR
)$(bindir)/$(LEN
)
92 rm -f
$(DESTDIR
)$(bindir)/$(SEN
)
95 # Deleting all the installed files
96 # --------------------------------
98 rm -f
$(DESTDIR
)$(bindir)/$(SEN
)
99 rm -f
$(DESTDIR
)$(bindir)/$(LEN
)
100 rm -f
$(DESTDIR
)$(libdir)/$(SONAME
)
103 # Performing self-test
104 # --------------------
107 .PHONY
: test baseline
109 @
$(MAKE
) --no-print-directory
-C
test
112 @
$(MAKE
) --no-print-directory
-C
test baseline
115 # Performing installation test
116 # ----------------------------
120 # Creating installation directories
121 # ---------------------------------
123 test -d
$(DESTDIR
)$(bindir) ||
$(INSTALL
) -d
$(DESTDIR
)$(bindir)
126 # Creating dependencies
127 # ---------------------
130 Makefile.dep
: $(srcdir)/*.
cc $(srcdir)/*.h
131 $(MAKEDEP
) $(CPPFLAGS
) $(filter %.
cc,$^
) >Makefile.dep
133 -include Makefile.dep
134 include $(srcdir)/clean.mk
140 $(TN
).src
: $(LEN
) shared_lib
142 $(LEN
): $(OBJECTS
) $(top_builddir
)/libcmd.a
$(top_builddir
)/libguiucsim.a
$(top_builddir
)/libsim.a
$(top_builddir
)/libucsimutil.a
143 $(CXX
) $(CXXFLAGS
) $(LDFLAGS
) $(OBJECTS
) $(LIBS
) -o
$@
148 ifeq ($(dlso_ok
),yes
)
149 shared_lib
: $(top_builddir
)/$(SONAME
)
150 install_shared_lib
: shared_lib
151 test -d
$(DESTDIR
)$(libdir) ||
$(INSTALL
) -d
$(DESTDIR
)$(libdir)
152 $(INSTALL
) $(top_builddir
)/$(SONAME
) $(DESTDIR
)$(libdir)/$(SONAME
)
155 @
$(top_srcdir
)/mkecho
$(top_builddir
) "No $(TN) shared lib made."
156 @
$(top_srcdir
)/mkecho
$(top_builddir
) "(SHAREDLIB="$(SHAREDLIB
)",dl_ok="$(dl_ok
)",enable_dlso="$(enable_dlso
)")"
160 $(top_builddir
)/$(SONAME
): $(OBJECTS_SHARED
)
161 $(CXX
) -shared
$(LDFLAGS
) $(OBJECTS_SHARED
) -o
$(top_builddir
)/s
$(TN
).so
163 otherlibs
: $(top_builddir
)/libcmd.a
$(top_builddir
)/libguiucsim.a
$(top_builddir
)/libsim.a
$(top_builddir
)/libucsimutil.a
165 $(top_builddir
)/libcmd.a
:
166 $(MAKE
) -C
$(top_builddir
)/cmd.src
all
168 $(top_builddir
)/libguiucsim.a
:
169 $(MAKE
) -C
$(top_builddir
)/gui.src checkconf ucsim_lib
171 $(top_builddir
)/libsim.a
:
172 $(MAKE
) -C
$(top_builddir
)/sim.src
all
174 $(top_builddir
)/libucsimutil.a
:
175 $(MAKE
) -C
$(top_builddir
) -f main.mk
178 $(CXX
) $(CXXFLAGS
) $(PICOPT
) $(CPPFLAGS
) $(TARGET_ARCH
) -c
$< -o
$@
181 $(Z80ASM
) -l
$< -o
$@
-e
$<.lst
184 # Remaking configuration
185 # ----------------------
187 @if
[ -f
$(top_builddir
)/devel
]; then\
188 $(MAKE
) -f conf.mk
srcdir="$(srcdir)" top_builddir
="$(top_builddir)" freshconf
;\
191 # End of z80.src/Makefile.in