[ucsim] Redesing use of OPT flag
[sdcc.git] / sdcc / sim / ucsim / m68hc08.src / Makefile.in
blobffcfb1e0e429f3989a69e345236984e4a608e8e4
2 # uCsim hc08.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
7 # tool name
8 TN = m68hc08
9 OLD = hc08
11 STARTYEAR = 1997
13 SHELL = /bin/sh
14 CXX = @CXX@
15 CPP = @CPP@
16 CXXCPP = @CXXCPP@
17 RANLIB = @RANLIB@
18 INSTALL = @INSTALL@
19 STRIP = @STRIP@
20 MAKEDEP = @MAKEDEP@
22 top_builddir = @top_builddir@
23 top_srcdir = @top_srcdir@
25 transform = @program_transform_name@
27 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
28 CPPFLAGS = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
29 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
30 -I$(top_srcdir)/gui.src
31 OPT ?= 2
32 CFLAGS = @WALL_FLAG@ @CFLAGS@ -O$(OPT)
33 CXXFLAGS = @WALL_FLAG@ @CXXFLAGS@ -O$(OPT)
34 LDFLAGS = @LDFLAGS@
35 PICOPT = @PICOPT@
36 SHAREDLIB = @SHAREDLIB@
38 EXEEXT = @EXEEXT@
40 LIBS = -L$(top_builddir) -lsim -lucsimutil -lguiucsim -lcmd -lsim @LIBS@
41 DL = @DL@
42 dl_ok = @dl_ok@
44 prefix = @prefix@
45 exec_prefix = @exec_prefix@
46 bindir = @bindir@
47 libdir = @libdir@
48 datadir = @datadir@
49 datarootdir = @datarootdir@
50 includedir = @includedir@
51 mandir = @mandir@
52 man1dir = $(mandir)/man1
53 man2dir = $(mandir)/man2
54 infodir = @infodir@
55 srcdir = @srcdir@
56 VPATH = @srcdir@
58 OBJECTS_SHARED = glob.o inst.o sim$(TN).o $(TN).o
59 OBJECTS_EXE = s$(TN).o
60 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
62 # short/long exe and lib name
63 SEN = s$(TN)$(EXEEXT)
64 LEN = ucsim_$(TN)$(EXEEXT)
65 SONAME = libucsim_$(TN).so
66 SOLD = s$(OLD)$(EXEEXT)
67 LOLD = ucsim_$(OLD)$(EXEEXT)
69 HC08ASM =
71 enable_dlso = @enable_dlso@
72 dlso_ok = @dlso_ok@
74 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
75 # test_arith.hex
77 # Compiling entire program or any subproject
78 # ------------------------------------------
79 all: checkconf otherlibs $(TN).src tests
81 tests: $(TEST_OBJ)
84 # Compiling and installing everything and running test
85 # ---------------------------------------------------
86 install: all installdirs install_shared_lib
87 $(INSTALL) $(LEN) $(DESTDIR)$(bindir)/$(LEN)
88 $(STRIP) $(DESTDIR)$(bindir)/$(LEN)
89 rm -f $(DESTDIR)$(bindir)/$(SEN)
90 rm -f $(DESTDIR)$(bindir)/$(SOLD)
91 rm -f $(DESTDIR)$(bindir)/$(LOLD)
94 # Deleting all the installed files
95 # --------------------------------
96 uninstall:
97 rm -f $(DESTDIR)$(bindir)/$(SEN)
98 rm -f $(DESTDIR)$(bindir)/$(LEN)
99 rm -f $(DESTDIR)$(libdir)/$(SONAME)
102 # Performing self-test
103 # --------------------
104 check: test
106 .PHONY: test baseline
107 test:
108 @$(MAKE) --no-print-directory -C test
110 baseline:
111 @$(MAKE) --no-print-directory -C test baseline
114 # Performing installation test
115 # ----------------------------
116 installcheck:
119 # Creating installation directories
120 # ---------------------------------
121 installdirs:
122 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
125 # Creating dependencies
126 # ---------------------
127 dep: Makefile.dep
129 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
130 $(MAKEDEP) $(CPPFLAGS) $(filter %.cc,$^) >Makefile.dep
132 -include Makefile.dep
133 include $(srcdir)/clean.mk
135 # My rules
136 # --------
137 .SUFFIXES: .asm .hex
139 $(TN).src: $(LEN) shared_lib
141 $(LEN): $(OBJECTS) $(top_builddir)/libcmd.a $(top_builddir)/libguiucsim.a $(top_builddir)/libsim.a $(top_builddir)/libucsimutil.a
142 $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
144 #$(LEN): $(SEN)
145 # cp $< $@
147 #olds: $(SOLD) $(LOLD)
149 #$(SOLD): $(SEN)
150 # cp $< $@
152 #$(LOLD): $(LEN)
153 # cp $< $@
155 ifeq ($(dlso_ok),yes)
156 shared_lib: $(top_builddir)/$(SONAME)
157 install_shared_lib: shared_lib
158 test -d $(DESTDIR)$(libdir) || $(INSTALL) -d $(DESTDIR)$(libdir)
159 $(INSTALL) $(top_builddir)/$(SONAME) $(DESTDIR)$(libdir)/$(SONAME)
160 else
161 shared_lib:
162 @$(top_srcdir)/mkecho $(top_builddir) "No $(TN) shared lib made."
163 @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
164 install_shared_lib:
165 endif
167 $(top_builddir)/$(SONAME): $(OBJECTS_SHARED)
168 $(CXX) -shared $(LDFLAGS) $(OBJECTS_SHARED) -o $@
170 otherlibs: $(top_builddir)/libcmd.a $(top_builddir)/libguiucsim.a $(top_builddir)/libsim.a $(top_builddir)/libucsimutil.a
172 $(top_builddir)/libcmd.a:
173 $(MAKE) -C $(top_builddir)/cmd.src all
175 $(top_builddir)/libguiucsim.a:
176 $(MAKE) -C $(top_builddir)/gui.src checkconf ucsim_lib
178 $(top_builddir)/libsim.a:
179 $(MAKE) -C $(top_builddir)/sim.src all
181 $(top_builddir)/libucsimutil.a:
182 $(MAKE) -C $(top_builddir) -f main.mk
184 .cc.o:
185 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
187 .asm.hex:
188 $(HC08ASM) -l $< -o $@ -e $<.lst
191 # Remaking configuration
192 # ----------------------
193 checkconf:
194 @if [ -f $(top_builddir)/devel ]; then\
195 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
198 # End of m68hc08.src/Makefile.in