blob: 0631d903f78154c9400e122a564b0d0a0753af69 (
plain)
1 PREFIX := /usr
2 CCOPTS = -Wall -Werror --std=gnu18 -O2
3
4 all: build_journal build_todo
5
6 _obj:
7 if [ ! -d obj ]; then mkdir obj; fi
8
9 _common: _obj
10 cc $(CCOPTS) src/common.c -c -o obj/common.o
11
12 _config: _obj
13 cc $(CCOPTS) src/config.c -c -o obj/config.o
14
15 build_todo: _common _config
16 cc $(CCOPTS) src/todo.c obj/*.o -o todo
17
18 build_journal: _common _config
19 cc $(CCOPTS) src/journal.c obj/*.o -o journal
20
21 install:
22 install -D -m 755 journal $(DESTDIR)$(PREFIX)/bin/journal
23 install -D -m 755 todo $(DESTDIR)$(PREFIX)/bin/todo
24 install -D -m 644 template.md $(DESTDIR)$(PREFIX)/share/dailyjournal/template.md
|