Enabled VPATH feature: changed nearly all Makefiles (149 files).
[fw/sdcc] / as / hc08 / Makefile.in
index e9d5b9928b081f1b86f0481fe076804668b1fa2e..799da3d321e1fe44bf517621a0a00c91c0409c18 100644 (file)
@@ -13,7 +13,8 @@ CPP           = @CPP@
 INSTALL                = @INSTALL@
 STRIP           = @STRIP@
 
-PRJDIR         = ../..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 srcdir         = @srcdir@
 prefix         = @prefix@
@@ -29,7 +30,9 @@ infodir         = @info@
 
 EXEEXT          = @EXEEXT@
 
-CPPFLAGS       = @CPPFLAGS@ -I. -I$(PRJDIR)
+VPATH           = @srcdir@
+
+CPPFLAGS       = @CPPFLAGS@ -I. -I$(srcdir)
 CFLAGS         = @CFLAGS@ -Wall
 M_OR_MM                = @M_OR_MM@
 LDFLAGS                = @LDFLAGS@
@@ -41,12 +44,12 @@ ASSOURCES   = $(patsubst %.o,%.c,$(ASOBJECTS))
 
 LKOBJECTS      = lkmain.o lkhead.o lkarea.o lkdata.o \
                  lkeval.o lklex.o lksym.o lkrloc.o \
-                 lklibr.o lklist.o lkihx.o lks19.o \
+                 lklibr.o lklist.o lkihx.o lks19.o lkelf.o \
                  lkstore.o lknoice.o lkmem.o lkaomf51.o strcmpi.o
 LKSOURCES      = $(patsubst %.o,%.c,$(LKOBJECTS))
 
-ASHC08         = $(PRJDIR)/bin/as-hc08$(EXEEXT)
-ASLINK         = $(PRJDIR)/bin/link-hc08$(EXEEXT)
+ASHC08         = $(top_builddir)bin/as-hc08$(EXEEXT)
+ASLINK         = $(top_builddir)bin/link-hc08$(EXEEXT)
 
 transform       = @program_transform_name@
 
@@ -63,15 +66,15 @@ $(ASLINK): $(LKOBJECTS)
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
-       $(INSTALL) $(ASHC08) `echo $(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
-       $(INSTALL) $(ASLINK) `echo $(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
+       $(INSTALL) $(ASHC08) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
+       $(INSTALL) $(ASLINK) `echo $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)|sed '$(transform)'`
 
 # Deleting all the installed files
 # --------------------------------
 uninstall:
-       rm -f $(bindir)/as-hc08$(EXEEXT) $(bindir)/link-hc08$(EXEEXT)
+       rm -f $(DESTDIR)$(bindir)/as-hc08$(EXEEXT) $(DESTDIR)$(bindir)/link-hc08$(EXEEXT)
 
 
 # Performing self-test
@@ -87,18 +90,21 @@ installcheck:
 # Creating installation directories
 # ---------------------------------
 installdirs:
-       $(INSTALL) -d $(bindir)
+       $(INSTALL) -d $(DESTDIR)$(bindir)
 
 
 # Creating dependencies
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: $(ASSOURCES) $(LKSOURCES) *.h $(PRJDIR)/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(ASSOURCES) $(LKSOURCES) >Makefile.dep
+Makefile.dep: $(ASSOURCES) $(LKSOURCES) $(srcdir)/*.h $(top_builddir)*.h $(top_srcdir)/*.h
+       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -109,8 +115,8 @@ include clean.mk
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-          $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+          $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
         fi
 
 # End of Makefile