2 # uCsim hc08.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
17 top_builddir = @top_builddir@
18 top_srcdir = @top_srcdir@
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
28 SHAREDLIB = @SHAREDLIB@
32 LIBS = -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim @LIBS@
37 exec_prefix = @exec_prefix@
41 datarootdir = @datarootdir@
42 includedir = @includedir@
44 man1dir = $(mandir)/man1
45 man2dir = $(mandir)/man2
50 OBJECTS_SHARED = glob.o \
54 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
58 enable_dlso = @enable_dlso@
61 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
64 # Compiling entire program or any subproject
65 # ------------------------------------------
66 all: checkconf otherlibs hc08.src tests
71 # Compiling and installing everything and runing test
72 # ---------------------------------------------------
73 install: all installdirs
74 $(INSTALL) shc08$(EXEEXT) $(DESTDIR)$(bindir)/shc08$(EXEEXT)
75 $(STRIP) $(DESTDIR)$(bindir)/shc08$(EXEEXT)
78 # Deleting all the installed files
79 # --------------------------------
81 rm -f $(DESTDIR)$(bindir)/shc08$(EXEEXT)
84 # Performing self-test
85 # --------------------
91 # Performing installation test
92 # ----------------------------
96 # Creating installation directories
97 # ---------------------------------
99 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
102 # Creating dependencies
103 # ---------------------
106 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
107 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
110 include $(srcdir)/clean.mk
116 hc08.src: shc08$(EXEEXT) shared_lib
118 shc08$(EXEEXT): $(OBJECTS) $(top_builddir)/*.a
119 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
121 ifeq ($(dlso_ok),yes)
122 shared_lib: $(top_builddir)/shc08.so
125 @$(top_srcdir)/mkecho $(top_builddir) "No hc08 shared lib made."
126 @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
129 $(top_builddir)/shc08.so: $(OBJECTS_SHARED)
130 $(CXX) -shared $(OBJECTS_SHARED) -o $(top_builddir)/shc08.so
133 $(MAKE) -C $(top_builddir)/cmd.src all
134 $(MAKE) -C $(top_builddir)/sim.src all
137 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
140 $(HC08ASM) -l $< -o $@ -e $<.lst
143 # Remaking configuration
144 # ----------------------
146 @if [ -f $(top_builddir)/devel ]; then\
147 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
150 # End of hc08.src/Makefile.in