Git.pm: clean generated files.
[gitweb.git] / Makefile
index ee9508e465149ba5f0abbc8e4e49e14f0c9d5c9f..703016725358c7122a211261eca946f17b31452f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -94,6 +94,8 @@ CFLAGS = -g -O2 -Wall
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
+PERL_CFLAGS =
+PERL_LDFLAGS =
 STRIP ?= strip
 
 prefix = $(HOME)
@@ -119,8 +121,8 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
 # Those must not be GNU-specific; they are shared with perl/ which may
 # be built by a different compiler.
-BASIC_CFLAGS =
-BASIC_LDFLAGS =
+BASIC_CFLAGS = $(PERL_CFLAGS)
+BASIC_LDFLAGS = $(PERL_LDFLAGS)
 
 SCRIPT_SH = \
        git-bisect.sh git-branch.sh git-checkout.sh \
@@ -339,6 +341,9 @@ endif
 ifneq (,$(findstring arm,$(uname_M)))
        ARM_SHA1 = YesPlease
 endif
+ifeq ($(uname_M),x86_64)
+       USE_PIC = YesPlease
+endif
 
 -include config.mak
 
@@ -544,7 +549,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
 $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/Makefile
 $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
        rm -f $@ $@+
-       INSTLIBDIR=`make -s -C perl instlibdir` && \
+       INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
        sed -e '1s|#!.*perl\(.*\)|#!$(PERL_PATH_SQ)\1|' \
            -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
            -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
@@ -766,6 +771,7 @@ clean:
        rm -f $(htmldocs).tar.gz $(manpages).tar.gz
        $(MAKE) -C Documentation/ clean
        [ ! -f perl/Makefile ] || $(MAKE) -C perl/ clean || $(MAKE) -C perl/ clean
+       rm -f perl/ppport.h perl/Makefile.old
        $(MAKE) -C templates/ clean
        $(MAKE) -C t/ clean
        rm -f GIT-VERSION-FILE GIT-CFLAGS