-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (26 loc) · 885 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
PROG = sasty
CC = gcc
CFLAGS = $(shell pkg-config --cflags menuw ncursesw json-c)
PREFIX = /usr/local
FILES = $(wildcard *.c)
OBJ = $(patsubst %.c, %.o, $(FILES))
OBJDEV = $(patsubst %.c, %.o-dev, $(FILES))
LIBS = $(shell pkg-config --libs menuw ncursesw json-c)
.PHONY: all dev install clean analyze
all: ${PROG}
${PROG}: ${OBJ}
${CC} ${KIK_PROD_CFLAGS} ${CFLAGS} $^ -o ${PROG} ${LIBS}
%.o: %.c
${CC} ${KIK_PROD_CFLAGS} ${CFLAGS} -c $< -o $@
dev: ${PROG}-dev
ctags --kinds-C=+p ${FILES} *.h $(shell project_headers ${CFLAGS} ${LIBS})
${PROG}-dev: ${OBJDEV}
${CC} ${KIK_DEV_CFLAGS} ${CFLAGS} $^ -o ${PROG}-dev ${LIBS}
%.o-dev: %.c
${CC} ${KIK_DEV_CFLAGS} ${CFLAGS} -c $< -o $@
install: ${PROG}
install -D ${PROG} ${PREFIX}/bin/${PROG}
clean:
rm -f ${PROG} ${PROG}-dev *.o *.o-dev
analyze:
scan-build clang ${KIK_PROD_CFLAGS} ${CFLAGS} ${FILES} -o /dev/null ${LIBS}