2 # uCsim hc08.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
19 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
20 CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) \
21 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
22 CFLAGS = @CFLAGS@ -Wall
23 CXXFLAGS = @CXXFLAGS@ -Wall
26 SHAREDLIB = @SHAREDLIB@
30 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
35 exec_prefix = @exec_prefix@
39 includedir = @includedir@
41 man1dir = $(mandir)/man1
42 man2dir = $(mandir)/man2
46 OBJECTS_SHARED = glob.o \
50 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
54 enable_dlso = @enable_dlso@
57 #TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
60 # Compiling entire program or any subproject
61 # ------------------------------------------
62 all: checkconf otherlibs hc08.src tests
67 # Compiling and installing everything and runing test
68 # ---------------------------------------------------
69 install: all installdirs
70 $(INSTALL) shc08$(EXEEXT) $(DESTDIR)$(bindir)/shc08$(EXEEXT)
71 $(STRIP) $(DESTDIR)$(bindir)/shc08$(EXEEXT)
74 # Deleting all the installed files
75 # --------------------------------
77 rm -f $(DESTDIR)$(bindir)/shc08$(EXEEXT)
80 # Performing self-test
81 # --------------------
87 # Performing installation test
88 # ----------------------------
92 # Creating installation directories
93 # ---------------------------------
95 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
98 # Creating dependencies
99 # ---------------------
102 Makefile.dep: *.cc *.h
103 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
112 hc08.src: shc08$(EXEEXT) shared_lib
114 shc08$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
115 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
117 ifeq ($(dlso_ok),yes)
118 shared_lib: $(PRJDIR)/shc08.so
121 @$(PRJDIR)/mkecho $(PRJDIR) "No hc08 shared lib made."
122 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
125 $(PRJDIR)/shc08.so: $(OBJECTS_SHARED)
126 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/shc08.so
129 cd $(PRJDIR)/cmd.src && $(MAKE) all
130 cd $(PRJDIR)/sim.src && $(MAKE) all
133 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
136 $(HC08ASM) -l $< -o $@ -e $<.lst
139 # Remaking configuration
140 # ----------------------
142 @if [ -f $(PRJDIR)/devel ]; then\
143 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
146 # End of hc08.src/Makefile.in