8aed4371f08b92a44ff7f6b7dbc5f61fd23f26af
[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
16 PRJDIR          = ..
17
18 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
19 CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
20                   -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
21 CFLAGS          = @CFLAGS@ -Wall
22 CXXFLAGS        = @CXXFLAGS@ -Wall
23 M_OR_MM         = @M_OR_MM@
24 PICOPT          = @PICOPT@
25 SHAREDLIB       = @SHAREDLIB@
26
27 EXEEXT          = @EXEEXT@
28
29 LIBS            = @LIBS@ -L$(PRJDIR) -lutil -lsim -lutil -lcmd -lguiucsim
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) -s sz80$(EXEEXT) $(bindir)
76
77
78 # Deleting all the installed files
79 # --------------------------------
80 uninstall:
81         rm -f $(bindir)/sz80$(EXEEXT)
82
83
84 # Performing self-test
85 # --------------------
86 check: test
87
88 test:
89
90
91 # Performing installation test
92 # ----------------------------
93 installcheck:
94
95
96 # Creating installation directories
97 # ---------------------------------
98 installdirs:
99         test -d $(bindir) || $(INSTALL) -d $(bindir)
100
101
102 # Creating dependencies
103 # ---------------------
104 dep: Makefile.dep
105
106 Makefile.dep: *.cc *.h
107         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
108
109 include Makefile.dep
110 include clean.mk
111
112 # My rules
113 # --------
114 .SUFFIXES: .asm .hex
115
116 z80.src: sz80$(EXEEXT)  shared_lib
117
118 sz80$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
119         $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
120
121 ifeq ($(dlso_ok),yes)
122 shared_lib: $(PRJDIR)/sz80.so
123 else
124 shared_lib:
125         @$(PRJDIR)/mkecho $(PRJDIR) "No z80 shared lib made."
126         @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
127 endif
128
129 $(PRJDIR)/sz80.so: $(OBJECTS_SHARED)
130         $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/sz80.so
131
132 otherlibs:
133         cd $(PRJDIR)/cmd.src && $(MAKE) all
134         cd $(PRJDIR)/sim.src && $(MAKE) all
135
136 .cc.o:
137         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
138
139 .asm.hex:
140         $(Z80ASM) -l $< -o $@ -e $<.lst
141
142
143 # Remaking configuration
144 # ----------------------
145 checkconf:
146         @if [ -f $(PRJDIR)/devel ]; then\
147           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
148         fi
149
150 # End of z80.src/Makefile.in