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 -DINDEXLIB -I. -I$(srcdir) -I$(srcdir)/../../support/Util
43 UTILLIB = $(srcdir)/../../support/Util
44 UTILSRC = dbuf.c dbuf_string.c
45 UTILLIBOBJS = $(UTILSRC:%.c=$(OBJDIR)/%.o)
47 ASXXLIB = $(srcdir)/../asxxsrc
48 ASXXLIBSRC = strcmpi.c assym.c aslex.c asnoice.c
49 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
51 SRC = asmain.c assubr.c \
52 asexpr.c asdata.c aslist.c asout.c \
53 i51ext.c i51pst.c i51mch.c i51adr.c
54 OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
56 ASSOURCES = $(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c) $(UTILSRC:%.c=$(UTILLIB)/%.c)
58 ASOBJECTS = $(OBJS) $(ASXXLIBOBJS) $(UTILLIBOBJS)
60 ASX = $(top_builddir)/bin/asx8051$(EXEEXT)
61 DEST = $(DESTDIR)$(bindir)/asx8051$(EXEEXT)
63 transform = @program_transform_name@
65 # Compiling entire program or any subproject
66 # ------------------------------------------
70 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS)
72 # Compiling and installing everything and running test
73 # ----------------------------------------------------
74 install: all installdirs
75 $(INSTALL) $(ASX) `echo $(DEST)|sed '$(transform)'`
76 $(STRIP) `echo $(DEST)|sed '$(transform)'`
78 # Deleting all the installed files
79 # --------------------------------
84 # Performing self-test
85 # --------------------
89 # Performing installation test
90 # ----------------------------
94 # Creating installation directories
95 # ---------------------------------
97 $(INSTALL) -d $(DESTDIR)$(bindir)
100 # Creating dependencies
101 # ---------------------
104 Makefile.dep: $(ASSOURCES) $(srcdir)/*.h
105 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
107 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
108 clean distclean mostlyclean realclean)" ""
109 -include Makefile.dep
111 include $(srcdir)/clean.mk
117 touch $(OBJDIR)/.stamp
119 $(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp
120 $(CC) -c $(CFLAGS) -o $@ $<
122 $(OBJDIR)/%.o: $(ASXXLIB)/%.c $(OBJDIR)/.stamp
123 $(CC) -c $(CFLAGS) -o $@ $<
125 $(OBJDIR)/%.o: $(UTILLIB)/%.c $(OBJDIR)/.stamp
126 $(CC) -c $(CFLAGS) -o $@ $<
129 # Remaking configuration
130 # ----------------------
132 @if [ -f $(top_builddir)/devel ]; then\
133 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\