X-Git-Url: http://git.refcnt.org/?p=colorize.git;a=blobdiff_plain;f=Makefile;h=33b66a776bba5ff5328abb48d92b551de03dd758;hp=ca0ee68c0a5619faf4fa973677cb975b19b37fa0;hb=HEAD;hpb=b7c53ca151ffdaa31b335a21296d02457ab969ea diff --git a/Makefile b/Makefile index ca0ee68..33b66a7 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,35 @@ -.PHONY: check clean +.PHONY: check check_valgrind install clean release readme .SUFFIXES: .SUFFIXES: .c .o SHELL=/bin/sh CC=gcc -CFLAGS=-ansi -pedantic +CFLAGS:=-ansi -pedantic $(CFLAGS) +FLAGS= # command-line macro colorize: colorize.c - $(CC) $(CFLAGS) -o colorize colorize.c -DCFLAGS="$(CFLAGS)" + perl ./version.pl > version.h + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o colorize colorize.c \ + -DCPPFLAGS="\"$(CPPFLAGS)\"" -DCFLAGS="\"$(CFLAGS)\"" -DLDFLAGS="\"$(LDFLAGS)\"" \ + -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: - [ -e colorize ] && rm colorize; exit 0 + rm -f a.out colorize debug.txt version.h + +release: + sh ./release.sh + +readme: + perl ./readme.pl