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