X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=makefile;h=244b08b71f633c786b75196e75bde5aa488088a3;hb=992542eb3341474f168e8b970332b4c388c5c1e7;hp=1306505b43cff45698ee673f689dc820dd872154;hpb=fbe8722498e76917f73e88b835852505f3763779;p=lackey diff --git a/makefile b/makefile index 1306505..244b08b 100644 --- a/makefile +++ b/makefile @@ -9,24 +9,27 @@ PREFIX ?= /usr/local MANPREFIX ?= $(PREFIX)/share/man # Compiler -CC ?= gcc +GCC ?= gcc CFLAGS ?= -Wall --std=c99 CPPFLAGS ?= -Isrc LDFLAGS ?= -lncursesw -lical # Sources PROG ?= lackey -PROG_SRC ?= main view date cal util +PROG_SRC ?= main view date cal util TEST ?= test TEST_SRC ?= test date util VIEWS ?= day week month year events todo settings help CALS ?= dummy ical +# For ncursesw +CPPFLAGS += $(strip $(shell pkg-config --cflags ncursesw)) + # Targets all: $(PROG) clean: - rm -f src/*.o views/*.o cals/*.o $(PROG) $(TEST) + rm -f src/*.o views/*.o cals/*.o $(PROG) $(TEST) dist: tar -czf $(PROG)-$(VERSION).tar.gz --transform s::$(PROG)-$(VERSION)/: \ @@ -40,14 +43,21 @@ uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG) rm -f $(DESTDIR)$(MANPREFIX)/man1/$(PROG).1 +memcheck: $(PROG) + valgrind --log-file=valgrind.out \ + --track-origins=yes \ + --leak-check=full \ + --leak-resolution=high \ + ./$(PROG) + # Rules $(PROG): $(PROG_SRC:%=src/%.o) $(VIEWS:%=views/%.o) $(CALS:%=cals/%.o) - $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) + $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS) $(TEST): $(TEST_SRC:%=src/%.o) $(CALS:%=cals/%.o) - $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) + $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS) %.o: %.c $(wildcard src/*.h) makefile - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + $(GCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< .PHONY: all clean dist install uninstall