[ucsim] Redesing use of OPT flag
[sdcc.git] / sdcc / sim / ucsim / m6800.src / Makefile.in
blobcc7d49f68247abefbbde52916ac4ecd0e54ce4f2
2 # uCsim m6800.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
7 # tool name
8 TN = m6800
10 STARTYEAR = 1997
12 SHELL = /bin/sh
13 CXX = @CXX@
14 CPP = @CPP@
15 CXXCPP = @CXXCPP@
16 RANLIB = @RANLIB@
17 INSTALL = @INSTALL@
18 STRIP = @STRIP@
19 MAKEDEP = @MAKEDEP@
21 top_builddir = @top_builddir@
22 top_srcdir = @top_srcdir@
24 transform = @program_transform_name@
26 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
27 CPPFLAGS = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
28 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
29 -I$(top_srcdir)/gui.src -I$(top_srcdir)/motorola.src
30 OPT ?= 2
31 CFLAGS = @WALL_FLAG@ @CFLAGS@ -O$(OPT)
32 CXXFLAGS = @WALL_FLAG@ @CXXFLAGS@ -O$(OPT)
33 LDFLAGS = @LDFLAGS@
34 PICOPT = @PICOPT@
35 SHAREDLIB = @SHAREDLIB@
36 EXEEXT = @EXEEXT@
38 LIBS = -L$(top_builddir) -lmotorola -lsim -lucsimutil -lguiucsim -lcmd -lsim @LIBS@
39 DL = @DL@
40 dl_ok = @dl_ok@
42 prefix = @prefix@
43 exec_prefix = @exec_prefix@
44 bindir = @bindir@
45 libdir = @libdir@
46 datadir = @datadir@
47 datarootdir = @datarootdir@
48 includedir = @includedir@
49 mandir = @mandir@
50 man1dir = $(mandir)/man1
51 man2dir = $(mandir)/man2
52 infodir = @infodir@
53 srcdir = @srcdir@
54 VPATH = @srcdir@
56 OBJECTS_SHARED = sim$(TN).o $(TN).o glob.o irq.o \
57 inst.o ialu.o ibranch.o imove.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
67 enable_dlso = @enable_dlso@
68 dlso_ok = @dlso_ok@
70 M6800ASM =
71 TEST_OBJ =
74 # Compiling entire program or any subproject
75 # ------------------------------------------
76 all: checkconf otherlibs $(TN).src
79 # Compiling and installing everything and running test
80 # ---------------------------------------------------
81 install: all installdirs install_shared_lib
82 $(INSTALL) $(LEN) $(DESTDIR)$(bindir)/$(LEN)
83 $(STRIP) $(DESTDIR)$(bindir)/$(LEN)
84 rm -f $(DESTDIR)$(bindir)/$(SEN)
87 # Deleting all the installed files
88 # --------------------------------
89 uninstall:
90 rm -f $(DESTDIR)$(bindir)/$(SEN)
91 rm -f $(DESTDIR)$(bindir)/$(LEN)
92 rm -f $(DESTDIR)$(libdir)/$(SONAME)
95 # Performing self-test
96 # --------------------
97 check: $(TEST_OBJ)
99 .PHONY: test baseline
100 test:
101 @$(MAKE) --no-print-directory -C test
103 baseline:
104 @$(MAKE) --no-print-directory -C test baseline
107 # Performing installation test
108 # ----------------------------
109 installcheck:
112 # Creating installation directories
113 # ---------------------------------
114 installdirs:
115 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
118 # Creating dependencies
119 # ---------------------
120 dep: Makefile.dep
122 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
123 $(MAKEDEP) $(CPPFLAGS) $(filter %.cc,$^) >Makefile.dep
125 -include Makefile.dep
126 include $(srcdir)/clean.mk
128 # My rules
129 # --------
130 .SUFFIXES: .asm .hex
132 $(TN).src: $(LEN) shared_lib $(TN)lib
134 $(LEN): $(OBJECTS) $(top_builddir)/libcmd.a $(top_builddir)/libguiucsim.a $(top_builddir)/libsim.a $(top_builddir)/libucsimutil.a $(top_builddir)/libmotorola.a
135 $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
137 #$(LEN): $(SEN)
138 # cp $< $@
140 $(TN)lib: $(top_builddir)/lib$(TN).a
142 $(top_builddir)/lib$(TN).a: $(OBJECTS_SHARED)
143 $(AR) -rc $@ $(OBJECTS_SHARED)
144 $(RANLIB) $@
146 ifeq ($(dlso_ok),yes)
147 shared_lib: $(top_builddir)/$(SONAME)
148 install_shared_lib: shared_lib
149 test -d $(DESTDIR)$(libdir) || $(INSTALL) -d $(DESTDIR)$(libdir)
150 $(INSTALL) $(top_builddir)/$(SONAME) $(DESTDIR)$(libdir)/$(SONAME)
151 else
152 shared_lib:
153 @$(top_srcdir)/mkecho $(top_builddir) "No $(TN) shared lib made."
154 @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
155 install_shared_lib:
156 endif
158 $(top_builddir)/$(SONAME): $(OBJECTS_SHARED)
159 $(CXX) -shared $(LDFLAGS) $(OBJECTS_SHARED) -o $@
161 otherlibs: $(top_builddir)/libcmd.a $(top_builddir)/libguiucsim.a $(top_builddir)/libsim.a $(top_builddir)/libucsimutil.a $(top_builddir)/libmotorola.a
163 $(top_builddir)/libcmd.a:
164 $(MAKE) -C $(top_builddir)/cmd.src all
166 $(top_builddir)/libguiucsim.a:
167 $(MAKE) -C $(top_builddir)/gui.src checkconf ucsim_lib
169 $(top_builddir)/libsim.a:
170 $(MAKE) -C $(top_builddir)/sim.src all
172 $(top_builddir)/libucsimutil.a:
173 $(MAKE) -C $(top_builddir) -f main.mk
175 $(top_builddir)/libmotorola.a:
176 $(MAKE) -C $(top_builddir)/motorola.src all
178 .cc.o:
179 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
181 .asm.hex:
182 $(M6800ASM) -l $< -o $@ -e $<.lst
185 # Remaking configuration
186 # ----------------------
187 checkconf:
188 @if [ -f $(top_builddir)/devel ]; then\
189 $(MAKE) -C $(top_builddir) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
192 # End of m6800.src/Makefile.in