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