# 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=
+# DESTDIR=
PROGRAMS=git-mailsplit git-mailinfo
SCRIPTS=git-applymbox git-applypatch
git-%: %.c
- $(CC) $(CFLAGS) -o $@ $(filter %.c,$^)
+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.c,$^)
all: $(PROGRAMS)
install: $(PROGRAMS) $(SCRIPTS)
$(INSTALL) -m755 -d $(dest)$(bindir)
- $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(dest)$(bindir)
+ $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(DESTDIR)$(bindir)
clean:
rm -f $(PROGRAMS) *.o