-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
45 lines (40 loc) · 1.21 KB
/
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
NAME = fuf
VERSION = "$(shell git describe --tag)"
CFLAGS = -Os
LIBS = -lncurses -lpthread
SRC = ${NAME}.c inc/colors.c inc/sort.c inc/thr.c inc/sysext.c inc/sncurses.c
OBJ = ${SRC:.c=.o}
DESTDIR = /usr
CC = gcc
XHACKS := yes
ifeq ($(XHACKS),yes)
LIBS += -DX_HACKS -lX11
SRC += inc/xhacks.c
OBJ = ${SRC:.c=.o}
endif
.c.o:
@echo CC -c ${CFLAGS} $<
@${CC} -c ${CFLAGS} -DVERSION=\"${VERSION}\" $< ${LIBS} -o ${<:.c=.o}
${NAME}: ${SRC} ${OBJ}
@echo CC -o $@
@${CC} -o $@ ${CFLAGS} ${OBJ} ${LIBS}
clean:
@echo cleaning...
@rm -f ${NAME} ${OBJ}
install: ${NAME}
@echo installing executable file to ${DESTDIR}/bin
@mkdir -p ${DESTDIR}/bin
@cp -f ${NAME} ${DESTDIR}/bin/${NAME}
@chmod 755 ${DESTDIR}/bin/${NAME}
@echo installing scripts
@mkdir -p ${DESTDIR}/lib/${NAME}
@cp -f scripts/* ${DESTDIR}/lib/${NAME}
@cp -f completions/zsh/_${NAME} ${DESTDIR}/share/zsh/site-functions/
@cp -f completions/bash/${NAME} ${DESTDIR}/share/bash-completion/completions/
uninstall: ${NAME}
@echo removing executable file from ${DESTDIR}/bin
@rm -f ${DESTDIR}/bin/${NAME}
@echo removing scripts
@rm -rf ${DESTDIR}/lib/${NAME}
@rm ${DESTDIR}/share/zsh/site-functions/_${NAME}
@rm ${DESTDIR}/share/bash-completion/completions/${NAME}