Makefile (758B)
1 CC = gcc 2 3 NAME = disco-dl 4 VERSION = 0.1 5 6 # paths 7 PREFIX = /usr/local 8 MANPREFIX = ${PREFIX}/share/man 9 10 BIN = disco-dl 11 SRC = ${BIN:=.c} 12 OBJ = ${SRC:.c=.o} 13 MAN1 = ${BIN:=.1} 14 15 ${OBJ}: config.h 16 17 all: ${BIN} 18 19 ${BIN}: ${@:=.o} 20 21 .o: ${OBJ} 22 ${CC} -o $@ ${OBJ} ${LDFLAGS} 23 24 clean: 25 rm -f ${BIN} ${OBJ} 26 27 config.h: 28 cp config.def.h $@ 29 30 install: all 31 mkdir -p ${DESTDIR}${PREFIX}/bin 32 cp -f ${BIN} "${DESTDIR}${PREFIX}/bin" 33 chmod 755 "${DESTDIR}${PREFIX}/bin/${BIN}" 34 mkdir -p "${DESTDIR}${MANPREFIX}/man1" 35 sed "s/VERSION/${VERSION}/g" < ${MAN1} > "${DESTDIR}${MANPREFIX}/man1/${MAN1}" 36 chmod 644 "${DESTDIR}${MANPREFIX}/man1/${MAN1}" 37 38 uninstall: 39 rm -f \ 40 "${DESTDIR}${PREFIX}/bin/${BIN}"\ 41 "${DESTDIR}${MANPREFIX}/man1/${MAN1}" 42 43 .PHONY: all clean install uninstall