From 5a571cdd8ab390e13fc02da6d6489d2ffa668aa4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 12 Aug 2005 01:03:07 -0700 Subject: Clean generated files a bit more, to cope with Debian build droppings. Also attempt to build a source package for debian. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e8441af577..f53ccb424c 100644 --- a/Makefile +++ b/Makefile @@ -238,15 +238,18 @@ rpm: dist deb: dist rm -rf $(GIT_TARNAME) tar zxf $(GIT_TARNAME).tar.gz + dpkg-source -b $(GIT_TARNAME) cd $(GIT_TARNAME) && fakeroot debian/rules binary ### Cleaning rules clean: rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE) - rm -f $(GIT_TARNAME).tar.gz git-core.spec - rm -f git-core_$(GIT_VERSION)-*.deb git-tk_$(GIT_VERSION)-*.deb + rm -f git-core.spec rm -rf $(GIT_TARNAME) + rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz + rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc + rm -f git-tk_$(GIT_VERSION)-*.deb $(MAKE) -C tools/ clean $(MAKE) -C Documentation/ clean $(MAKE) -C templates/ clean -- cgit v1.2.3 From b05701c5b4c7983ef04d8c286c65089596553bd6 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sat, 6 Aug 2005 01:36:15 -0400 Subject: Make CFLAGS overridable from make command line. This patch renames COPTS to CFLAGS, because it's COPTS that was user overridable. Also, -Wall is moved there because it's optional. What was CFLAGS is now ALL_CFLAGS, which users should not override. Defines are added to DEFINES. Since ALL_CFLAGS is recursively expanded, it uses the final value of DEFINES. Implicit rules are made explicit since the implicit rules use CFLAGS rather than ALL_CFLAGS. I believe that serious projects should not rely on implicit rules anyway. Percent rules are used because they are used already and because they don't need the .SUFFIXES target. [jc: in addition to updating the patch for 0.99.4, I fixed up a glitch in Pavel's original patch which compiled sha1.o out of mozilla-sha1/sha1.c, where it should have left the resulting object file in mozilla-sha1 directory for later "ar".] Signed-off-by: Pavel Roskin Signed-off-by: Junio C Hamano --- Makefile | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f53ccb424c..3e9b40621d 100644 --- a/Makefile +++ b/Makefile @@ -32,24 +32,24 @@ # DEFINES += -DUSE_STDEV -GIT_VERSION=0.99.4 +GIT_VERSION = 0.99.4 -COPTS?=-g -O2 -CFLAGS+=$(COPTS) -Wall $(DEFINES) +CFLAGS = -g -O2 -Wall +ALL_CFLAGS = $(CFLAGS) $(DEFINES) -prefix=$(HOME) -bindir=$(prefix)/bin -template_dir=$(prefix)/share/git-core/templates/ +prefix = $(HOME) +bindir = $(prefix)/bin +template_dir = $(prefix)/share/git-core/templates/ # dest= -CC?=gcc -AR?=ar -INSTALL?=install -RPMBUILD?=rpmbuild +CC = gcc +AR = ar +INSTALL = install +RPMBUILD = rpmbuild # sparse is architecture-neutral, which means that we need to tell it # explicitly what architecture to check for. Fix this up for yours.. -SPARSE_FLAGS?=-D__BIG_ENDIAN__ -D__powerpc__ +SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ @@ -125,7 +125,7 @@ ifndef NO_OPENSSL LIB_OBJS += epoch.o OPENSSL_LIBSSL=-lssl else - CFLAGS += '-DNO_OPENSSL' + DEFINES += '-DNO_OPENSSL' MOZILLA_SHA1=1 OPENSSL_LIBSSL= endif @@ -146,7 +146,7 @@ endif endif endif -CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)' +DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)' @@ -156,12 +156,15 @@ all: $(PROG) all: $(MAKE) -C templates + $(MAKE) -C tools + +%.o: %.c + $(CC) -o $*.o -c $(ALL_CFLAGS) $< +%.o: %.S + $(CC) -o $*.o -c $(ALL_CFLAGS) $< -.SECONDARY: %.o -.c.o: - $(CC) $(CFLAGS) -o $*.o -c $*.c git-%: %.o $(LIB_FILE) - $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) + $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) git-http-pull: pull.o git-local-pull: pull.o @@ -172,7 +175,8 @@ git-http-pull: LIBS += -lcurl git-rev-list: LIBS += $(OPENSSL_LIBSSL) init-db.o: init-db.c - $(CC) -c $(CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir)"' $*.c + $(CC) -c $(ALL_CFLAGS) \ + -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir)"' $*.c $(LIB_OBJS): $(LIB_H) $(patsubst git-%,%.o,$(PROG)): $(LIB_H) @@ -192,13 +196,13 @@ test: all $(MAKE) -C t/ all test-date: test-date.c date.o - $(CC) $(CFLAGS) -o $@ test-date.c date.o + $(CC) $(ALL_CFLAGS) -o $@ test-date.c date.o test-delta: test-delta.c diff-delta.o patch-delta.o - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(ALL_CFLAGS) -o $@ $^ check: - for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done + for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done -- cgit v1.2.3 From a682ef9f06075b4bb83dcf479c91d578125084b9 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 5 Aug 2005 01:56:38 +0200 Subject: [PATCH] Use $DESTDIR instead of $dest $DESTDIR is more usual during the build than $dest and is what is usually used in the makefiles, so let's use it too. Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3e9b40621d..2e8ed5af17 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ ALL_CFLAGS = $(CFLAGS) $(DEFINES) prefix = $(HOME) bindir = $(prefix)/bin template_dir = $(prefix)/share/git-core/templates/ -# dest= +# DESTDIR= CC = gcc AR = ar @@ -209,8 +209,8 @@ check: ### Installation rules install: $(PROG) $(SCRIPTS) - $(INSTALL) -m755 -d $(dest)$(bindir) - $(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bindir) + $(INSTALL) -m755 -d $(DESTDIR)$(bindir) + $(INSTALL) $(PROG) $(SCRIPTS) $(DESTDIR)$(bindir) $(MAKE) -C templates install install-tools: -- cgit v1.2.3 From 3e386508f87278610d1892aaaa08cd17907f71c5 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 5 Aug 2005 00:52:46 +0200 Subject: [PATCH] Unify Makefile indentation Use instead of two spaces uniformly in the Makefile, even in the ifdefs. Gives it a nice consistent look. [jc: At the same time I indented the nested ifdefs to make them slightly easier to read.] Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- Makefile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2e8ed5af17..aeba3e7eb7 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ PROG= git-update-cache git-diff-files git-init-db git-write-tree \ git-update-server-info git-show-rev-cache git-build-rev-cache ifndef NO_CURL -PROG+= git-http-pull + PROG+= git-http-pull endif LIB_FILE=libgit.a @@ -130,20 +130,20 @@ else OPENSSL_LIBSSL= endif ifdef MOZILLA_SHA1 - SHA1_HEADER="mozilla-sha1/sha1.h" - LIB_OBJS += mozilla-sha1/sha1.o + SHA1_HEADER="mozilla-sha1/sha1.h" + LIB_OBJS += mozilla-sha1/sha1.o else -ifdef PPC_SHA1 - SHA1_HEADER="ppc/sha1.h" - LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o -else - SHA1_HEADER= -ifeq ($(shell uname -s),Darwin) - LIBS += -lcrypto -lssl -else - LIBS += -lcrypto -endif -endif + ifdef PPC_SHA1 + SHA1_HEADER="ppc/sha1.h" + LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o + else + SHA1_HEADER= + ifeq ($(shell uname -s),Darwin) + LIBS += -lcrypto -lssl + else + LIBS += -lcrypto + endif + endif endif DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)' -- cgit v1.2.3 From 704a66f52edbc0cc88dca3b0993a072ae49d0f39 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 12 Aug 2005 10:37:33 -0700 Subject: Make tools/ directory first-class citizen. Tools directory being separate is just a historical coincidence. Build and install together with the main directory, just like the clean target does. Signed-off-by: Junio C Hamano --- Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index aeba3e7eb7..76f36cd360 100644 --- a/Makefile +++ b/Makefile @@ -212,8 +212,6 @@ install: $(PROG) $(SCRIPTS) $(INSTALL) -m755 -d $(DESTDIR)$(bindir) $(INSTALL) $(PROG) $(SCRIPTS) $(DESTDIR)$(bindir) $(MAKE) -C templates install - -install-tools: $(MAKE) -C tools install install-doc: -- cgit v1.2.3