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