2019-04-27 05:37:22 +00:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
CC=cc
|
|
|
|
CFLAGS=-W -O
|
|
|
|
|
|
|
|
LDFLAGS=
|
|
|
|
LDLIBS=
|
|
|
|
|
2019-04-27 05:41:23 +00:00
|
|
|
PREFIX=/usr/local
|
|
|
|
|
2019-04-29 03:42:44 +00:00
|
|
|
SRC = src/journal/main.o \
|
2019-04-30 05:20:32 +00:00
|
|
|
src/journal/journal.o
|
2019-04-29 03:42:44 +00:00
|
|
|
|
2019-04-27 05:41:23 +00:00
|
|
|
all: ensure_bin journal
|
|
|
|
|
|
|
|
ensure_bin: bin
|
|
|
|
mkdir -p bin
|
2019-04-27 05:37:22 +00:00
|
|
|
|
|
|
|
install: journal
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
|
|
cp -f bin/journal $(DESTDIR)$(PREFIX)/bin
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm $(DESTDIR)$(PREFIX)/bin/journal
|
|
|
|
|
2019-04-27 05:41:23 +00:00
|
|
|
# currently we only have one journal util, others may come later
|
2019-04-29 03:42:44 +00:00
|
|
|
journal: $(SRC)
|
|
|
|
$(CC) $(LDFLAGS) -o bin/journal $(SRC) $(LDLIBS)
|
2019-04-27 05:37:22 +00:00
|
|
|
|
2019-04-29 03:42:44 +00:00
|
|
|
src/journal/journal.o: src/journal/journal.c
|
2019-04-27 05:37:22 +00:00
|
|
|
src/journal/main.o: src/journal/main.c
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm bin/journal src/journal/*.o
|
|
|
|
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
.c.o:
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|