# 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__
LIB_OBJS += epoch.o
OPENSSL_LIBSSL=-lssl
else
- CFLAGS += '-DNO_OPENSSL'
+ DEFINES += '-DNO_OPENSSL'
MOZILLA_SHA1=1
OPENSSL_LIBSSL=
endif
endif
endif
-CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
+DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'
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
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)
$(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
# Make Linus git-tools
#
CC=gcc
-COPTS=-O2
-CFLAGS=-g $(COPTS) -Wall
+CFLAGS = -O2 -g -Wall
+ALL_CFLAGS = $(CFLAGS)
INSTALL=install
-HOME=$(shell echo $$HOME)
prefix=$(HOME)
bindir=$(prefix)/bin
# dest=
SCRIPTS=git-applymbox git-applypatch
git-%: %.c
- $(CC) $(CFLAGS) -o $@ $(filter %.c,$^)
+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.c,$^)
all: $(PROGRAMS)