X-Git-Url: http://pileus.org/git/?p=lackey;a=blobdiff_plain;f=makefile;h=ce82c84d434401e28ec17441bdcaafe6733bb5ff;hp=1306505b43cff45698ee673f689dc820dd872154;hb=d45541aeb31a0e34a2a43df0e112f1f720f80abf;hpb=fbe8722498e76917f73e88b835852505f3763779 diff --git a/makefile b/makefile index 1306505..ce82c84 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # lackey - curses calendar program -# See COPYING file for copyright and license details. +# See COPYING file for license details. -include config.mk @@ -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 util args conf date cal view print daemon TEST ?= test -TEST_SRC ?= test date util -VIEWS ?= day week month year events todo settings help +TEST_SRC ?= test util conf date cal daemon +VIEWS ?= day week month year events todo settings help edit CALS ?= dummy ical +# Objects +views/%.o cals/%.o: CFLAGS += -Isrc +src/view.o views/%.o: CFLAGS += $(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 $@ $< +%.o: %.c $(wildcard src/*.h makefile config.mk) + $(GCC) $(CFLAGS) -c -o $@ $< .PHONY: all clean dist install uninstall