]> Pileus Git - lackey/blobdiff - makefile
Update tests
[lackey] / makefile
index 9996deebf66058a1d41d60403e06d19def156587..ec91b830da4a2d8d1e50e99f47a53a7bd851aa82 100644 (file)
--- a/makefile
+++ b/makefile
@@ -16,17 +16,20 @@ 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
+TEST_SRC  ?= test date cal 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,6 +43,13 @@ 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)
        $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS)