[ucsim-z80] Intro r800, new z80 cpu type
[sdcc.git] / sdcc / sim / ucsim / z80.src / Makefile.in
blobaedc5b663d11baffea5dd5ba5c07f7a1a68cb6ab
2 # uCsim z80.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
7 # tool name
8 TN = z80
10 STARTYEAR = 1997
12 SHELL = /bin/sh
13 CXX = @CXX@
14 CPP = @CPP@
15 CXXCPP = @CXXCPP@
16 RANLIB = @RANLIB@
17 INSTALL = @INSTALL@
18 STRIP = @STRIP@
19 MAKEDEP = @MAKEDEP@
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@
32 LDFLAGS = @LDFLAGS@
33 PICOPT = @PICOPT@
34 SHAREDLIB = @SHAREDLIB@
35 EXEEXT = @EXEEXT@
37 LIBS = -L$(top_builddir) -lsim -lucsimutil -lguiucsim -lcmd -lsim @LIBS@
38 DL = @DL@
39 dl_ok = @dl_ok@
41 prefix = @prefix@
42 exec_prefix = @exec_prefix@
43 bindir = @bindir@
44 libdir = @libdir@
45 datadir = @datadir@
46 datarootdir = @datarootdir@
47 includedir = @includedir@
48 mandir = @mandir@
49 man1dir = $(mandir)/man1
50 man2dir = $(mandir)/man2
51 infodir = @infodir@
52 srcdir = @srcdir@
53 VPATH = @srcdir@
55 OBJECTS_SHARED = glob.o \
56 inst.o \
57 inst_cb.o \
58 inst_dd.o \
59 inst_ed.o \
60 inst_fd.o \
61 inst_ddcb.o \
62 inst_fdcb.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
69 SEN = s$(TN)$(EXEEXT)
70 LEN = ucsim_$(TN)$(EXEEXT)
71 SONAME = libucsim_$(TN).so
73 enable_dlso = @enable_dlso@
74 dlso_ok = @dlso_ok@
76 Z80ASM =
77 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
78 # test_arith.hex
80 # Compiling entire program or any subproject
81 # ------------------------------------------
82 all: checkconf otherlibs $(TN).src tests
84 tests: $(TEST_OBJ)
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 # --------------------------------
97 uninstall:
98 rm -f $(DESTDIR)$(bindir)/$(SEN)
99 rm -f $(DESTDIR)$(bindir)/$(LEN)
100 rm -f $(DESTDIR)$(libdir)/$(SONAME)
103 # Performing self-test
104 # --------------------
105 check: test
107 .PHONY: test baseline
108 test:
109 @$(MAKE) --no-print-directory -C test
111 baseline:
112 @$(MAKE) --no-print-directory -C test baseline
115 # Performing installation test
116 # ----------------------------
117 installcheck:
120 # Creating installation directories
121 # ---------------------------------
122 installdirs:
123 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
126 # Creating dependencies
127 # ---------------------
128 dep: Makefile.dep
130 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
131 $(MAKEDEP) $(CPPFLAGS) $(filter %.cc,$^) >Makefile.dep
133 -include Makefile.dep
134 include $(srcdir)/clean.mk
136 # My rules
137 # --------
138 .SUFFIXES: .asm .hex
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 $@
145 #$(LEN): $(SEN)
146 # cp $< $@
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)
153 else
154 shared_lib:
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)")"
157 install_shared_lib:
158 endif
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
177 .cc.o:
178 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
180 .asm.hex:
181 $(Z80ASM) -l $< -o $@ -e $<.lst
184 # Remaking configuration
185 # ----------------------
186 checkconf:
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