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 = @LIBS@ -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim
37 exec_prefix = @exec_prefix@
41 includedir = @includedir@
43 man1dir = $(mandir)/man1
44 man2dir = $(mandir)/man2
49 OBJECTS_SHARED = glob.o \
53 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
57 enable_dlso = @enable_dlso@
60 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
63 # Compiling entire program or any subproject
64 # ------------------------------------------
65 all: checkconf otherlibs hc08.src tests
70 # Compiling and installing everything and runing test
71 # ---------------------------------------------------
72 install: all installdirs
73 $(INSTALL) shc08$(EXEEXT) $(DESTDIR)$(bindir)/shc08$(EXEEXT)
74 $(STRIP) $(DESTDIR)$(bindir)/shc08$(EXEEXT)
77 # Deleting all the installed files
78 # --------------------------------
80 rm -f $(DESTDIR)$(bindir)/shc08$(EXEEXT)
83 # Performing self-test
84 # --------------------
90 # Performing installation test
91 # ----------------------------
95 # Creating installation directories
96 # ---------------------------------
98 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
101 # Creating dependencies
102 # ---------------------
105 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
106 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
109 include $(srcdir)/clean.mk
115 hc08.src: shc08$(EXEEXT) shared_lib
117 shc08$(EXEEXT): $(OBJECTS) $(top_builddir)*.a
118 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
120 ifeq ($(dlso_ok),yes)
121 shared_lib: $(top_builddir)shc08.so
124 @$(top_srcdir)/mkecho $(top_builddir) "No hc08 shared lib made."
125 @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
128 $(top_builddir)shc08.so: $(OBJECTS_SHARED)
129 $(CXX) -shared $(OBJECTS_SHARED) -o $(top_builddir)shc08.so
132 $(MAKE) -C $(top_builddir)cmd.src all
133 $(MAKE) -C $(top_builddir)sim.src all
136 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
139 $(HC08ASM) -l $< -o $@ -e $<.lst
142 # Remaking configuration
143 # ----------------------
145 @if [ -f $(top_builddir)devel ]; then\
146 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
149 # End of hc08.src/Makefile.in