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 -DUNIX -I.. -I$(srcdir)/..
43 ASXXLIB = $(srcdir)/../../asxxsrc
47 ASXXLIBSRC = strcmpi.c
49 LKLIBSRC = getline.c lkaomf51.c lkar.c lkdata.c lkeval.c \
50 lkhead.c lklex.c lklib.c lklibr.c lklist.c \
51 lknoice.c lkrel.c lksdcclib.c lkstore.c lksym.c
53 SRC = lkmain.c lkarea.c lkihx.c \
54 lkrloc.c lks19.c lkelf.c lkmem.c
56 LKSOURCES = $(SRC) $(LKLIBSRC:%.c=$(LKLIB)/%.c) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c)
58 OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
59 LKOBJS = $(LKLIBSRC:%.c=$(OBJDIR)/%.o)
60 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
61 LKOBJECTS = $(OBJS) $(LKOBJS) $(ASXXLIBOBJS)
63 ASLINK = $(top_builddir)/bin/link-hc08$(EXEEXT)
65 transform = @program_transform_name@
67 # Compiling entire program or any subproject
68 # ------------------------------------------
69 all: checkconf $(ASLINK)
73 $(ASLINK): $(LKOBJECTS)
74 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LKOBJECTS)
76 # Compiling and installing everything and running test
77 # ----------------------------------------------------
78 install: all installdirs
79 $(INSTALL) $(ASLINK) `echo $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
80 $(STRIP) `echo $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
82 # Deleting all the installed files
83 # --------------------------------
85 rm -f $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)
88 # Performing self-test
89 # --------------------
93 # Performing installation test
94 # ----------------------------
98 # Creating installation directories
99 # ---------------------------------
101 $(INSTALL) -d $(DESTDIR)$(bindir)
104 # Creating dependencies
105 # ---------------------
108 Makefile.dep: $(LKSOURCES) $(LKLIB)/*.h $(top_builddir)/*.h
109 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
111 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
112 clean distclean mostlyclean realclean)" ""
113 -include Makefile.dep
115 include $(srcdir)/clean.mk
121 touch $(OBJDIR)/.stamp
123 $(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp
124 $(CC) -c $(CFLAGS) -o $@ $<
126 $(OBJDIR)/%.o: $(LKLIB)/%.c $(OBJDIR)/.stamp
127 $(CC) -c $(CFLAGS) -o $@ $<
129 $(OBJDIR)/%.o: $(ASXXLIB)/%.c $(OBJDIR)/.stamp
130 $(CC) -c $(CFLAGS) -o $@ $<
133 # Remaking configuration
134 # ----------------------
136 @if [ -f $(top_builddir)/devel ]; then\
137 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\