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$(srcdir)/.. -I$(top_builddir)
37 CFLAGS = @CFLAGS@ -Wall -DUNIX -I$(srcdir)/.. -I$(top_builddir)
43 ASXXLIB = $(srcdir)/../../asxxsrc
47 ASXXLIBSRC = strcmpi.c
49 LKLIBSRC = lkaomf51.c lkdata.c lkeval.c \
50 lkhead.c lklex.c lklist.c \
51 lknoice.c lkstore.c lksym.c
53 SRC = lkmain.c lkarea.c lkihx.c \
54 lklibr.c lkrloc.c lks19.c \
57 LKSOURCES = $(SRC) $(LKLIBSRC:%.c=$(LKLIB)/%.c) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c)
59 OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
60 LKOBJS = $(LKLIBSRC:%.c=$(OBJDIR)/%.o)
61 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
62 LKOBJECTS = $(OBJS) $(LKOBJS) $(ASXXLIBOBJS)
64 ASLINK = $(top_builddir)/bin/link-hc08$(EXEEXT)
66 transform = @program_transform_name@
68 # Compiling entire program or any subproject
69 # ------------------------------------------
70 all: checkconf $(ASLINK)
74 $(ASLINK): $(LKOBJECTS)
75 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LKOBJECTS)
77 # Compiling and installing everything and running test
78 # ----------------------------------------------------
79 install: all installdirs
80 $(INSTALL) $(ASLINK) `echo $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
81 $(STRIP) `echo $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
83 # Deleting all the installed files
84 # --------------------------------
86 rm -f $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)
89 # Performing self-test
90 # --------------------
94 # Performing installation test
95 # ----------------------------
99 # Creating installation directories
100 # ---------------------------------
102 $(INSTALL) -d $(DESTDIR)$(bindir)
105 # Creating dependencies
106 # ---------------------
109 Makefile.dep: $(LKSOURCES) $(LKLIB)/*.h $(top_builddir)/*.h
110 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
112 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
113 clean distclean mostlyclean realclean)" ""
114 -include Makefile.dep
116 include $(srcdir)/clean.mk
122 touch $(OBJDIR)/.stamp
124 $(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp
125 $(CC) -c $(CFLAGS) -o $@ $<
127 $(OBJDIR)/%.o: $(LKLIB)/%.c $(OBJDIR)/.stamp
128 $(CC) -c $(CFLAGS) -o $@ $<
130 $(OBJDIR)/%.o: $(ASXXLIB)/%.c $(OBJDIR)/.stamp
131 $(CC) -c $(CFLAGS) -o $@ $<
134 # Remaking configuration
135 # ----------------------
137 @if [ -f $(top_builddir)/devel ]; then\
138 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\