# 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)
-bin=$(prefix)/bin
-# dest=
+bindir=$(prefix)/bin
+# 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)$(bin)
- $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(dest)$(bin)
+ $(INSTALL) -m755 -d $(dest)$(bindir)
+ $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(DESTDIR)$(bindir)
clean:
rm -f $(PROGRAMS) *.o