forked from LemonBoy/bar
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (37 loc) · 881 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
39
40
41
42
43
44
45
46
47
48
49
CC ?= gcc
STRIP ?= strip
CFLAGS = -std=c99 -fshort-wchar -Os
LDFLAGS = -lxcb
XINERAMA ?= 0
ifneq "$(XINERAMA)" "0"
LDFLAGS += -lxcb-xinerama
CFLAGS += -DXINERAMA=${XINERAMA}
endif
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long\
-Wsign-conversion -Wconversion -Wimplicit-function-declaration
EXEC = bar
SRCS = bar.c
OBJS = ${SRCS:.c=.o}
PREFIX?=/usr
BINDIR=${PREFIX}/bin
all: ${EXEC}
.c.o:
${CC} ${CFLAGS} -o $@ -c $<
${OBJS}: config.h
config.h:
@echo creating $@ from config.def.h
@cp config.def.h $@
${EXEC}: ${OBJS}
${CC} -o ${EXEC} ${OBJS} ${LDFLAGS}
${STRIP} -s ${EXEC}
debug: ${EXEC}
debug: CC += ${CFDEBUG}
clean:
rm -rf ./*.o
rm -rf ./${EXEC}
install: bar
test -d ${DESTDIR}${BINDIR} || mkdir -p ${DESTDIR}${BINDIR}
install -m755 bar ${DESTDIR}${BINDIR}/bar
uninstall:
rm -f ${DESTDIR}${BINDIR}/bar
.PHONY: all debug clean install