[ucsim] Redesing use of OPT flag
[sdcc.git] / sdcc / sim / ucsim / tlcs.src / Makefile.in
blob9e2ac048eb570cc8996812178209afa3095fd103
2 # uCsim tlcs.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
8 # tool name
9 TN = tlcs
11 STARTYEAR = 2016
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@
37 EXEEXT = @EXEEXT@
39 LIBS = -L$(top_builddir) -lsim -lucsimutil -lguiucsim -lcmd -lsim @LIBS@
40 DL = @DL@
41 dl_ok = @dl_ok@
43 prefix = @prefix@
44 exec_prefix = @exec_prefix@
45 bindir = @bindir@
46 libdir = @libdir@
47 datadir = @datadir@
48 datarootdir = @datarootdir@
49 includedir = @includedir@
50 mandir = @mandir@
51 man1dir = $(mandir)/man1
52 man2dir = $(mandir)/man2
53 infodir = @infodir@
54 srcdir = @srcdir@
55 VPATH = @srcdir@
57 OBJECTS_SHARED = glob.o \
58 sim$(TN).o $(TN).o \
59 inst_block.o inst_cpu_others.o inst_rot_sh.o \
60 inst_jump.o inst_move.o inst_arith.o inst_bit.o
61 OBJECTS_EXE = s$(TN).o
62 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
64 # short/long exe and lib name
65 SEN = s$(TN)$(EXEEXT)
66 LEN = ucsim_$(TN)$(EXEEXT)
67 SONAME = libucsim_$(TN).so
69 enable_dlso = @enable_dlso@
70 dlso_ok = @dlso_ok@
73 # Compiling entire program or any subproject
74 # ------------------------------------------
75 all: checkconf otherlibs $(TN).src
78 # Compiling and installing everything and running test
79 # ---------------------------------------------------
80 install: all installdirs install_shared_lib
81 $(INSTALL) $(LEN) $(DESTDIR)$(bindir)/$(LEN)
82 $(STRIP) $(DESTDIR)$(bindir)/$(LEN)
83 rm -f $(DESTDIR)$(bindir)/$(SEN)
86 # Deleting all the installed files
87 # --------------------------------
88 uninstall:
89 rm -f $(DESTDIR)$(bindir)/$(SEN)
90 rm -f $(DESTDIR)$(bindir)/$(LEN)
91 rm -f $(DESTDIR)$(libdir)/$(SONAME)
94 # Performing self-test
95 # --------------------
96 check: $(TEST_OBJ)
98 .PHONY: test baseline
99 test:
100 @$(MAKE) --no-print-directory -C test
102 baseline:
103 @$(MAKE) --no-print-directory -C test baseline
106 # Performing installation test
107 # ----------------------------
108 installcheck:
111 # Creating installation directories
112 # ---------------------------------
113 installdirs:
114 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
117 # Creating dependencies
118 # ---------------------
119 dep: Makefile.dep
121 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
122 $(MAKEDEP) $(CPPFLAGS) $(filter %.cc,$^) >Makefile.dep
124 -include Makefile.dep
125 include $(srcdir)/clean.mk
127 # My rules
128 # --------
129 $(TN).src: $(LEN) shared_lib
131 $(LEN): $(OBJECTS) $(top_builddir)/libcmd.a $(top_builddir)/libguiucsim.a $(top_builddir)/libsim.a $(top_builddir)/libucsimutil.a
132 $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
134 #$(LEN): $(SEN)
135 # cp $< $@
137 ifeq ($(dlso_ok),yes)
138 shared_lib: $(top_builddir)/$(SONAME)
139 install_shared_lib: shared_lib
140 test -d $(DESTDIR)$(libdir) || $(INSTALL) -d $(DESTDIR)$(libdir)
141 $(INSTALL) $(top_builddir)/$(SONAME) $(DESTDIR)$(libdir)/$(SONAME)
142 else
143 shared_lib:
144 @$(top_srcdir)/mkecho $(top_builddir) "No $(TN) shared lib made."
145 @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
146 install_shared_lib:
147 endif
149 $(top_builddir)/$(SONAME): $(OBJECTS_SHARED)
150 $(CXX) -shared $(LDFLAGS) $(OBJECTS_SHARED) -o $@
152 otherlibs: $(top_builddir)/libcmd.a $(top_builddir)/libguiucsim.a $(top_builddir)/libsim.a $(top_builddir)/libucsimutil.a
154 $(top_builddir)/libcmd.a:
155 $(MAKE) -C $(top_builddir)/cmd.src all
157 $(top_builddir)/libguiucsim.a:
158 $(MAKE) -C $(top_builddir)/gui.src checkconf ucsim_lib
160 $(top_builddir)/libsim.a:
161 $(MAKE) -C $(top_builddir)/sim.src all
163 $(top_builddir)/libucsimutil.a:
164 $(MAKE) -C $(top_builddir) -f main.mk
166 .cc.o:
167 $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
170 # Remaking configuration
171 # ----------------------
172 checkconf:
173 @if [ -f $(top_builddir)/devel ]; then\
174 $(MAKE) -C $(top_builddir) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
177 # End of tlcs.src/Makefile.in