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 ASX8051 = $(top_builddir)/bin/asx8051$(EXEEXT)
62 transform = @program_transform_name@
64 # Compiling entire program or any subproject
65 # ------------------------------------------
66 all: checkconf $(ASX8051)
68 $(ASX8051): $(ASOBJECTS)
69 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS)
71 # Compiling and installing everything and running test
72 # ----------------------------------------------------
73 install: all installdirs
74 $(INSTALL) $(ASX8051) `echo $(DESTDIR)$(bindir)/asx8051$(EXEEXT)|sed '$(transform)'`
75 $(STRIP) `echo $(DESTDIR)$(bindir)/asx8051$(EXEEXT)|sed '$(transform)'`
77 # Deleting all the installed files
78 # --------------------------------
80 rm -f $(DESTDIR)$(bindir)/asx8051$(EXEEXT)
83 # Performing self-test
84 # --------------------
88 # Performing installation test
89 # ----------------------------
93 # Creating installation directories
94 # ---------------------------------
96 $(INSTALL) -d $(DESTDIR)$(bindir)
99 # Creating dependencies
100 # ---------------------
103 Makefile.dep: $(ASSOURCES) $(srcdir)/*.h
104 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
106 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
107 clean distclean mostlyclean realclean)" ""
108 -include Makefile.dep
110 include $(srcdir)/clean.mk
116 touch $(OBJDIR)/.stamp
118 $(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp
119 $(CC) -c $(CFLAGS) -o $@ $<
121 $(OBJDIR)/%.o: $(ASXXLIB)/%.c $(OBJDIR)/.stamp
122 $(CC) -c $(CFLAGS) -o $@ $<
124 $(OBJDIR)/%.o: $(UTILLIB)/%.c $(OBJDIR)/.stamp
125 $(CC) -c $(CFLAGS) -o $@ $<
128 # Remaking configuration
129 # ----------------------
131 @if [ -f $(top_builddir)/devel ]; then\
132 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\