37 lines
610 B
Makefile
37 lines
610 B
Makefile
.POSIX:
|
|
.SUFFIXES:
|
|
|
|
CC=cc
|
|
CFLAGS=-W -O
|
|
|
|
LDFLAGS=
|
|
LDLIBS=
|
|
|
|
PREFIX=/usr/local
|
|
|
|
all: ensure_bin journal
|
|
|
|
ensure_bin: bin
|
|
mkdir -p bin
|
|
|
|
install: journal
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
cp -f bin/journal $(DESTDIR)$(PREFIX)/bin
|
|
|
|
uninstall:
|
|
rm $(DESTDIR)$(PREFIX)/bin/journal
|
|
|
|
# currently we only have one journal util, others may come later
|
|
journal: src/journal/main.o
|
|
$(CC) $(LDFLAGS) -o bin/journal src/journal/main.o $(LDLIBS)
|
|
|
|
src/journal/main.o: src/journal/main.c
|
|
|
|
clean:
|
|
rm bin/journal src/journal/*.o
|
|
|
|
.SUFFIXES: .c .o
|
|
.c.o:
|
|
# $< mean the prereqs
|
|
# $@ means the target
|
|
$(CC) $(CFLAGS) -c $< -o $@
|