* doc/Makefile,
[fw/sdcc] / src / Makefile.in
index 8dcdf7feac9e8f02d915ebefe4eea19befc06e4d..46d0e4c6cd78f92b9582265a15a9c9031417eb96 100644 (file)
@@ -44,7 +44,7 @@ TARGET                = $(PRJDIR)/bin/sdcc$(EXEEXT)
 
 # Compiling entire program or any subproject
 # ------------------------------------------
-all: checkconf $(TARGET)
+all: checkconf version.h $(TARGET)
 
 $(PORT_LIBS): FORCE 
        $(MAKE) -C `dirname $@`
@@ -57,14 +57,14 @@ $(PRJDIR)/support/gc/libgc.a:
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
-       $(INSTALL) $(TARGET) `echo $(bindir)/sdcc$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(bindir)/sdcc$(EXEEXT)|sed '$(transform)'`
+       $(INSTALL) $(TARGET) `echo $(DESTDIR)$(bindir)/sdcc$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/sdcc$(EXEEXT)|sed '$(transform)'`
 
 
 # Deleting all the installed files
 # --------------------------------
 uninstall:
-       rm -f $(bindir)/sdcc$(EXEEXT)
+       rm -f $(DESTDIR)$(bindir)/sdcc$(EXEEXT)
 
 # Performing self-test
 # --------------------
@@ -79,14 +79,14 @@ installcheck:
 # Creating installation directories
 # ---------------------------------
 installdirs:
-       $(INSTALL) -d $(bindir)
+       $(INSTALL) -d $(DESTDIR)$(bindir)
 
 
 # Creating dependencies
 # ---------------------
-dep: Makefile.dep
+dep: version.h Makefile.dep
 
-Makefile.dep: $(SOURCES) $(SLIBSOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
+Makefile.dep: version.h $(SOURCES) $(SLIBSOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
        $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) $(SLIBSOURCES) >Makefile.dep
 
 include Makefile.dep
@@ -117,6 +117,9 @@ SDCCy.c: SDCC.y
 SDCClex.c: SDCC.lex SDCCy.h
        $(LEX) -t $< >$@
 
+version.h: ../ChangeLog
+       $(AWK) -f version.awk $< > $@
+
 .y.c:
        rm -f $*.cc $*.h
        $(YACC) -d $<