-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
63 lines (48 loc) · 1.54 KB
/
makefile
File metadata and controls
63 lines (48 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# lackey - curses calendar program
# See COPYING file for license details.
-include config.mk
# Settings
VERSION ?= 0.1-rc1
PREFIX ?= /usr/local
MANPREFIX ?= $(PREFIX)/share/man
# Compiler
GCC ?= gcc
CFLAGS ?= -Wall --std=c99
CPPFLAGS ?= -Isrc
LDFLAGS ?= -lncursesw -lical
# Sources
PROG ?= lackey
PROG_SRC ?= main view date cal conf util
TEST ?= test
TEST_SRC ?= test date cal conf util
VIEWS ?= day week month year events todo settings help edit
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)
dist:
tar -czf $(PROG)-$(VERSION).tar.gz --transform s::$(PROG)-$(VERSION)/: \
README COPYING config.mk.example makefile */*.txt */*.1 */*.c */*.h
install: all
install -m 755 -D $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
install -m 644 -D doc/$(PROG).1 $(DESTDIR)$(MANPREFIX)/man1/$(PROG).1
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)
$(TEST): $(TEST_SRC:%=src/%.o) $(CALS:%=cals/%.o)
$(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
%.o: %.c $(wildcard src/*.h makefile config.mk)
$(GCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
.PHONY: all clean dist install uninstall