# lackey - curses calendar program
-# See COPYING file for copyright and license details.
+# See COPYING file for license details.
-include config.mk
# Compiler
GCC ?= gcc
CFLAGS ?= -Wall --std=c99
-CPPFLAGS ?= -Isrc
LDFLAGS ?= -lncursesw -lical
# Sources
PROG ?= lackey
-PROG_SRC ?= main view date cal conf util
+PROG_SRC ?= main util args conf date cal view print daemon
TEST ?= test
-TEST_SRC ?= test date cal conf util
+TEST_SRC ?= test util conf date cal daemon
VIEWS ?= day week month year events todo settings help edit
CALS ?= dummy ical
-# For ncursesw
-CPPFLAGS += $(strip $(shell pkg-config --cflags ncursesw))
+# Objects
+views/%.o cals/%.o: CFLAGS += -Isrc
+src/view.o views/%.o: CFLAGS += $(strip $(shell pkg-config --cflags ncursesw))
# Targets
all: $(PROG)
$(TEST): $(TEST_SRC:%=src/%.o) $(CALS:%=cals/%.o)
$(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
-%.o: %.c $(wildcard src/*.h) makefile
- $(GCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+%.o: %.c $(wildcard src/*.h makefile config.mk)
+ $(GCC) $(CFLAGS) -c -o $@ $<
.PHONY: all clean dist install uninstall