forked from tsoding/sowon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 810 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
COMMON_CFLAGS= -Wall -Wextra -std=c99 -pedantic
CFLAGS+= `pkg-config --cflags sdl2` $(COMMON_CFLAGS)
COMMON_LIBS= -lm
LIBS= `pkg-config --libs sdl2` $(COMMON_LIBS)
PREFIX?= /usr/local
INSTALL?= install
.PHONY: all
all: Makefile sowon man
sowon: main.c digits.h
$(CC) $(CFLAGS) -o sowon main.c $(LIBS)
digits.h: png2c digits.png
./png2c digits.png > digits.h
png2c: png2c.c
$(CC) $(COMMON_CFLAGS) -o png2c png2c.c -lm
docs/sowon.6.gz: docs/sowon.6
gzip -c docs/sowon.6 > docs/sowon.6.gz
.PHONY: man
man: docs/sowon.6.gz
.PHONY: clean
clean:
rm sowon docs/sowon.6.gz png2c
.PHONY: install
install: all
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -C ./sowon $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d $(DESTDIR)$(PREFIX)/man/man6
$(INSTALL) -C docs/sowon.6.gz $(DESTDIR)$(PREFIX)/man/man6