X-Git-Url: http://git.refcnt.org/?a=blobdiff_plain;f=Makefile;h=381f11aacc7366e2ec15221a59bb80688f0ceca9;hb=335d8c673c1251977c98bcd964cb2d6831c0c9f8;hp=d061794949a381d71485b18fca6146515a879201;hpb=5f02f11890b79f3254fbafa67ee6600982953856;p=colorize.git diff --git a/Makefile b/Makefile index d061794..381f11a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: check clean +.PHONY: check check_valgrind install clean release .SUFFIXES: .SUFFIXES: .c .o @@ -6,13 +6,25 @@ SHELL=/bin/sh CC=gcc CFLAGS=-ansi -pedantic +FLAGS= # command-line macro colorize: colorize.c perl ./version.pl > version.h - $(CC) $(CFLAGS) -o colorize colorize.c -DCFLAGS="$(CFLAGS)" -DHAVE_VERSION + $(CC) $(CFLAGS) -o colorize colorize.c -DCFLAGS="$(CFLAGS)" -DHAVE_VERSION $(FLAGS) check: - perl ./test.pl + perl ./test.pl --regular + +check_valgrind: + @which valgrind >/dev/null 2>&1 || (printf '%s\n' "valgrind not found" && exit 1) + perl ./test.pl --valgrind || exit 0 + +install: + test ! -d $(DESTDIR)/usr/bin && mkdir -p $(DESTDIR)/usr/bin || exit 0 + cp colorize $(DESTDIR)/usr/bin clean: - rm -f colorize version.h + rm -f a.out colorize debug.txt version.h + +release: + sh ./release.sh