6 VERSIONHI = @VERSIONHI@
7 VERSIONLO = @VERSIONLO@
16 top_builddir = @top_builddir@
17 top_srcdir = @top_srcdir@
21 exec_prefix = @exec_prefix@
25 datarootdir = @datarootdir@
26 includedir = @includedir@
28 man1dir = $(mandir)/man1
29 man2dir = $(mandir)/man2
36 CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)
37 CFLAGS = @CFLAGS@ -Wall
41 ASOBJECTS = asmain.o aslex.o assym.o assubr.o asnoice.o \
42 asexpr.o asdata.o aslist.o asout.o asstore.o \
43 m08ext.o m08pst.o m08mch.o m08adr.o \
45 ASSOURCES = $(patsubst %.o,%.c,$(ASOBJECTS))
47 ASHC08 = $(top_builddir)/bin/as-hc08$(EXEEXT)
49 transform = @program_transform_name@
51 # Compiling entire program or any subproject
52 # ------------------------------------------
53 all: checkconf $(ASHC08) $(ASLINK)
55 $(ASHC08): $(ASOBJECTS)
56 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS)
58 # Compiling and installing everything and runing test
59 # ---------------------------------------------------
60 install: all installdirs
61 $(INSTALL) $(ASHC08) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
62 $(STRIP) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
64 # Deleting all the installed files
65 # --------------------------------
67 rm -f $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)
70 # Performing self-test
71 # --------------------
75 # Performing installation test
76 # ----------------------------
80 # Creating installation directories
81 # ---------------------------------
83 $(INSTALL) -d $(DESTDIR)$(bindir)
86 # Creating dependencies
87 # ---------------------
90 Makefile.dep: $(ASSOURCES) $(srcdir)/*.h $(top_builddir)/*.h $(top_srcdir)/*.h
91 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
93 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
94 clean distclean mostlyclean realclean)" ""
97 include $(srcdir)/clean.mk
102 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
105 # Remaking configuration
106 # ----------------------
108 @if [ -f $(top_builddir)/devel ]; then\
109 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\