aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: fa0c1c633773bf5e8de18e4eb94720d42b3d1ddd (plain)
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
# See LICENSE for copyright information
include config.mk

SRC = bin/cpt-readlink.c bin/cpt-stat.c
OBJ = ${SRC:.c=.o}
BIN = ${SRC:.c=}

all: ${BIN}

.c.o:
	${CC} ${CFLAGS} -c -o $@ $<

${BIN}: ${OBJ}
	${CC} ${LDFLAGS} -o $@ $< ${LIBS}

clean:
	rm -f ${BIN} ${OBJ}

install: all
	install -Dm755 ${DESTDIR}${BINDIR}/cpt-lib lib.sh
	install -Dm755 ${DESTDIR}${BINDIR}/cpt     cpt
	for bin in tools/* ${BIN} contrib/*; do \
		install -Dm755 ${DESTDIR}${BINDIR}/$${bin##*/} $${bin}; done
	for man in man/*.1; do install -Dm644 ${DESTDIR}${MAN1}/$${man##*/} $${man}; done
	for doc in doc/*; do install -Dm644 ${DESTDIR}${CPTDOC}/$${doc##*/} $${doc}; done

uninstall:
	rm -f ${DESTDIR}${BINDIR}/cpt \
		${DESTDIR}${BINDIR}/cpt-lib
	for bin in ${BIN} tools/* contrib/*; do \
		rm -f ${DESTDIR}${BINDIR}/$${bin}; done
	rm -f ${DESTDIR}${MAN1}/kiss.1 ${DESTDIR}${MAN1}/kiss.1
	rm -f ${DESTDIR}${MAN1}/kiss-contrib.1 ${DESTDIR}${MAN1}/kiss-contrib.1
	rm -rf ${DESTDIR}${CPTDOC}


.PHONY: all install uninstall clean