-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 loc) · 921 Bytes
/
Makefile
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
# farbherd Makefile
CC ?= cc
CFLAGS ?= -O2
CPPFLAGS += -pedantic -Wall -Wextra
PREFIX ?= /usr/local
DESTDIR ?= /
# Don't change after here.
# Or do. I am not your mom.
BINS=fhinfo fhpack fhunpack fhwrap
DEP=src/farbherd.h
all: $(BINS)
fhinfo: src/fhinfo.c $(DEP)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ src/$@.c
fhpack: src/fhpack.c $(DEP)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ src/$@.c
fhunpack: src/fhunpack.c $(DEP)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ src/$@.c
fhwrap: src/fhwrap.c $(DEP)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ src/$@.c
.PHONY: install uninstall
install: $(BINS)
install -d $(DESTDIR)/$(PREFIX)/bin
install -d $(DESTDIR)/$(PREFIX)/include
install $(BINS) $(DESTDIR)/$(PREFIX)/bin
install src/farbherd.h $(DESTDIR)/$(PREFIX)/include
uninstall:
cd $(DESTDIR)/$(PREFIX)/bin && rm -f $(BINS)
rm -f $(DESTDIR)/$(PREFIX)/include/farbherd.h
clean:
rm -f $(BINS)