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