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