summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 18 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ca73231..0631d90 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,24 @@
PREFIX := /usr
CCOPTS = -Wall -Werror --std=gnu18 -O2
-.DEFAULT: build
-build:
- cc $(CCOPTS) src/main.c -o dailyjournal
+all: build_journal build_todo
+
+_obj:
+ if [ ! -d obj ]; then mkdir obj; fi
+
+_common: _obj
+ cc $(CCOPTS) src/common.c -c -o obj/common.o
+
+_config: _obj
+ cc $(CCOPTS) src/config.c -c -o obj/config.o
+
+build_todo: _common _config
+ cc $(CCOPTS) src/todo.c obj/*.o -o todo
+
+build_journal: _common _config
+ cc $(CCOPTS) src/journal.c obj/*.o -o journal
install:
- install -D -m 755 dailyjournal $(DESTDIR)$(PREFIX)/bin/dailyjournal
+ install -D -m 755 journal $(DESTDIR)$(PREFIX)/bin/journal
+ install -D -m 755 todo $(DESTDIR)$(PREFIX)/bin/todo
install -D -m 644 template.md $(DESTDIR)$(PREFIX)/share/dailyjournal/template.md

Generated by cgit