2 # uCsim hc08.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
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
32 CFLAGS
= @WALL_FLAG@ @CFLAGS@
-O
$(OPT
)
33 CXXFLAGS
= @WALL_FLAG@ @CXXFLAGS@
-O
$(OPT
)
36 SHAREDLIB
= @SHAREDLIB@
40 LIBS
= -L
$(top_builddir
) -lsim
-lucsimutil
-lguiucsim
-lcmd
-lsim @LIBS@
45 exec_prefix = @
exec_prefix@
49 datarootdir
= @datarootdir@
50 includedir = @
includedir@
52 man1dir = $(mandir)/man1
53 man2dir = $(mandir)/man2
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
64 LEN
= ucsim_
$(TN
)$(EXEEXT
)
65 SONAME
= libucsim_
$(TN
).so
66 SOLD
= s
$(OLD
)$(EXEEXT
)
67 LOLD
= ucsim_
$(OLD
)$(EXEEXT
)
71 enable_dlso
= @enable_dlso@
74 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
77 # Compiling entire program or any subproject
78 # ------------------------------------------
79 all: checkconf otherlibs
$(TN
).src tests
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 # --------------------------------
97 rm -f
$(DESTDIR
)$(bindir)/$(SEN
)
98 rm -f
$(DESTDIR
)$(bindir)/$(LEN
)
99 rm -f
$(DESTDIR
)$(libdir)/$(SONAME
)
102 # Performing self-test
103 # --------------------
106 .PHONY
: test baseline
108 @
$(MAKE
) --no-print-directory
-C
test
111 @
$(MAKE
) --no-print-directory
-C
test baseline
114 # Performing installation test
115 # ----------------------------
119 # Creating installation directories
120 # ---------------------------------
122 test -d
$(DESTDIR
)$(bindir) ||
$(INSTALL
) -d
$(DESTDIR
)$(bindir)
125 # Creating dependencies
126 # ---------------------
129 Makefile.dep
: $(srcdir)/*.
cc $(srcdir)/*.h
130 $(MAKEDEP
) $(CPPFLAGS
) $(filter %.
cc,$^
) >Makefile.dep
132 -include Makefile.dep
133 include $(srcdir)/clean.mk
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
$@
147 #olds: $(SOLD) $(LOLD)
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
)
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
)")"
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
185 $(CXX
) $(CXXFLAGS
) $(PICOPT
) $(CPPFLAGS
) $(TARGET_ARCH
) -c
$< -o
$@
188 $(HC08ASM
) -l
$< -o
$@
-e
$<.lst
191 # Remaking configuration
192 # ----------------------
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