-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 894 Bytes
/
Makefile
File metadata and controls
47 lines (35 loc) · 894 Bytes
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
# tools
CC = cc
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
# libs
LIBS = -lX11 -lXpm -lXext
# flags
CPPFLAGS = -D_DEFAULT_SOURCE
CFLAGS = -std=c99 -pedantic -Wall -Wextra -Os ${CPPFLAGS} -I/usr/X11R6/include
LDFLAGS = ${LIBS} -L/usr/X11R6/lib
# files
SRC = xpet.c
BIN = xpet
MAN = xpet.1
all: ${BIN}
${BIN}: ${SRC}
${CC} ${CFLAGS} ${SRC} -o ${BIN} ${LDFLAGS}
clean:
rm -f ${BIN}
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f ${BIN} ${DESTDIR}${PREFIX}/bin/
chmod 755 ${DESTDIR}${PREFIX}/bin/${BIN}
mkdir -p ${DESTDIR}${MANPREFIX}/man1
cp -f ${MAN} ${DESTDIR}${MANPREFIX}/man1/
chmod 644 ${DESTDIR}${MANPREFIX}/man1/${MAN}
uninstall:
rm -f \
${DESTDIR}${PREFIX}/bin/${BIN} \
${DESTDIR}${MANPREFIX}/man1/${MAN}
clangd:
rm -f compile_flags.txt
for f in ${CFLAGS}; do echo $$f >> compile_flags.txt; done
.PHONY: all clean install uninstall clangd