* */Makefile.in: removed annoying warning:
[fw/sdcc] / sim / ucsim / z80.src / Makefile.in
1 #
2 # uCsim z80.src/Makefile
3 #
4 # (c) Drotos Daniel, Talker Bt. 1997
5 #
6
7 STARTYEAR       = 1997
8
9 SHELL           = /bin/sh
10 CXX             = @CXX@
11 CPP             = @CPP@
12 CXXCPP          = @CXXCPP@
13 RANLIB          = @RANLIB@
14 INSTALL         = @INSTALL@
15 STRIP           = @STRIP@
16
17 top_builddir    = @top_builddir@
18 top_srcdir      = @top_srcdir@
19
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
26 LDFLAGS         = @LDFLAGS@
27 M_OR_MM         = @M_OR_MM@
28 PICOPT          = @PICOPT@
29 SHAREDLIB       = @SHAREDLIB@
30 EXEEXT          = @EXEEXT@
31
32 LIBS            = -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim @LIBS@
33 DL              = @DL@
34 dl_ok           = @dl_ok@
35
36 prefix          = @prefix@
37 exec_prefix     = @exec_prefix@
38 bindir          = @bindir@
39 libdir          = @libdir@
40 datadir         = @datadir@
41 datarootdir     = @datarootdir@
42 includedir      = @includedir@
43 mandir          = @mandir@
44 man1dir         = $(mandir)/man1
45 man2dir         = $(mandir)/man2
46 infodir         = @infodir@
47 srcdir          = @srcdir@
48 VPATH           = @srcdir@
49
50 OBJECTS_SHARED  = glob.o \
51                   inst.o \
52                   inst_cb.o \
53                   inst_dd.o \
54                   inst_ed.o \
55                   inst_fd.o \
56                   inst_ddcb.o \
57                   inst_fdcb.o \
58                   simz80.o z80.o
59 OBJECTS_EXE     = sz80.o
60 OBJECTS         = $(OBJECTS_SHARED) $(OBJECTS_EXE)
61
62 Z80ASM          = 
63
64 enable_dlso     = @enable_dlso@
65 dlso_ok         = @dlso_ok@
66
67 #TEST_OBJ       = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
68 #                 test_arith.hex
69
70 # Compiling entire program or any subproject
71 # ------------------------------------------
72 all: checkconf otherlibs z80.src tests
73
74 tests: $(TEST_OBJ)
75
76
77 # Compiling and installing everything and runing test
78 # ---------------------------------------------------
79 install: all installdirs
80         $(INSTALL) sz80$(EXEEXT) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
81         $(STRIP) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
82
83
84 # Deleting all the installed files
85 # --------------------------------
86 uninstall:
87         rm -f $(DESTDIR)$(bindir)/sz80$(EXEEXT)
88
89
90 # Performing self-test
91 # --------------------
92 check: test
93
94 test:
95
96
97 # Performing installation test
98 # ----------------------------
99 installcheck:
100
101
102 # Creating installation directories
103 # ---------------------------------
104 installdirs:
105         test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
106
107
108 # Creating dependencies
109 # ---------------------
110 dep: Makefile.dep
111
112 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
113         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
114
115 -include Makefile.dep
116 include $(srcdir)/clean.mk
117
118 # My rules
119 # --------
120 .SUFFIXES: .asm .hex
121
122 z80.src: sz80$(EXEEXT) shared_lib
123
124 sz80$(EXEEXT): $(OBJECTS) $(top_builddir)/*.a
125         $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
126
127 ifeq ($(dlso_ok),yes)
128 shared_lib: $(top_builddir)/sz80.so
129 else
130 shared_lib:
131         @$(top_srcdir)/mkecho $(top_builddir) "No z80 shared lib made."
132         @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
133 endif
134
135 $(top_builddir)/sz80.so: $(OBJECTS_SHARED)
136         $(CXX) -shared $(LDFLAGS) $(OBJECTS_SHARED) -o $(top_builddir)/sz80.so
137
138 otherlibs:
139         $(MAKE) -C $(top_builddir)/cmd.src all
140         $(MAKE) -C $(top_builddir)/sim.src all
141
142 .cc.o:
143         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
144
145 .asm.hex:
146         $(Z80ASM) -l $< -o $@ -e $<.lst
147
148
149 # Remaking configuration
150 # ----------------------
151 checkconf:
152         @if [ -f $(top_builddir)/devel ]; then\
153           $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
154         fi
155
156 # End of z80.src/Makefile.in