| 1 |
.PHONY: check check_valgrind install clean release readme |
| 2 |
|
| 3 |
.SUFFIXES: |
| 4 |
.SUFFIXES: .c .o |
| 5 |
|
| 6 |
SHELL=/bin/sh |
| 7 |
CC=gcc |
| 8 |
CFLAGS:=-ansi -pedantic $(CFLAGS) |
| 9 |
FLAGS= # command-line macro |
| 10 |
|
| 11 |
colorize: colorize.c |
| 12 |
perl ./version.pl > version.h |
| 13 |
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o colorize colorize.c \ |
| 14 |
-DCPPFLAGS="\"$(CPPFLAGS)\"" -DCFLAGS="\"$(CFLAGS)\"" -DLDFLAGS="\"$(LDFLAGS)\"" \ |
| 15 |
-DHAVE_VERSION $(FLAGS) |
| 16 |
|
| 17 |
check: |
| 18 |
perl ./test.pl --regular |
| 19 |
|
| 20 |
check_valgrind: |
| 21 |
@which valgrind >/dev/null 2>&1 || (printf '%s\n' "valgrind not found" && exit 1) |
| 22 |
perl ./test.pl --valgrind || exit 0 |
| 23 |
|
| 24 |
install: |
| 25 |
test ! -d $(DESTDIR)/usr/bin && mkdir -p $(DESTDIR)/usr/bin || exit 0 |
| 26 |
cp colorize $(DESTDIR)/usr/bin |
| 27 |
|
| 28 |
clean: |
| 29 |
rm -f a.out colorize debug.txt version.h |
| 30 |
|
| 31 |
release: |
| 32 |
sh ./release.sh |
| 33 |
|
| 34 |
readme: |
| 35 |
perl ./readme.pl |