# 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=mailsplit mailinfo
-SCRIPTS=applymbox applypatch
+PROGRAMS=git-mailsplit git-mailinfo
+SCRIPTS=git-applymbox git-applypatch
+
+git-%: %.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 $(DESTDIR)$(bindir)
+ $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(DESTDIR)$(bindir)
clean:
rm -f $(PROGRAMS) *.o