2 # uCsim hc08.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
18 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
19 CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) \
20 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
21 CFLAGS = @CFLAGS@ -Wall
22 CXXFLAGS = @CXXFLAGS@ -Wall
25 SHAREDLIB = @SHAREDLIB@
29 LIBS = @LIBS@ -L$(PRJDIR) -Wl,--start-group -lutil -lsim -lcmd -lguiucsim -Wl,--end-group
34 exec_prefix = @exec_prefix@
38 includedir = @includedir@
40 man1dir = $(mandir)/man1
41 man2dir = $(mandir)/man2
45 OBJECTS_SHARED = glob.o \
49 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
53 enable_dlso = @enable_dlso@
56 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
59 # Compiling entire program or any subproject
60 # ------------------------------------------
61 all: checkconf otherlibs hc08.src tests
66 # Compiling and installing everything and runing test
67 # ---------------------------------------------------
68 install: all installdirs
69 $(INSTALL) -s shc08$(EXEEXT) $(bindir)
72 # Deleting all the installed files
73 # --------------------------------
75 rm -f $(bindir)/shc08$(EXEEXT)
78 # Performing self-test
79 # --------------------
85 # Performing installation test
86 # ----------------------------
90 # Creating installation directories
91 # ---------------------------------
93 test -d $(bindir) || $(INSTALL) -d $(bindir)
96 # Creating dependencies
97 # ---------------------
100 Makefile.dep: *.cc *.h
101 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
110 hc08.src: shc08$(EXEEXT) shared_lib
112 shc08$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
113 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
115 ifeq ($(dlso_ok),yes)
116 shared_lib: $(PRJDIR)/shc08.so
119 @$(PRJDIR)/mkecho $(PRJDIR) "No hc08 shared lib made."
120 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
123 $(PRJDIR)/shc08.so: $(OBJECTS_SHARED)
124 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/shc08.so
127 cd $(PRJDIR)/cmd.src && $(MAKE) all
128 cd $(PRJDIR)/sim.src && $(MAKE) all
131 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
134 $(HC08ASM) -l $< -o $@ -e $<.lst
137 # Remaking configuration
138 # ----------------------
140 @if [ -f $(PRJDIR)/devel ]; then\
141 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
144 # End of hc08.src/Makefile.in