Makefile (547B)
1 name = walk 2 src = walk.c 3 obj = ${src:.c=.o} 4 objprereq = Makefile 5 6 prefix = /usr/local 7 manprefix = ${prefix}/man 8 9 cc = ${CC} 10 cflags = -Wall -Wno-write-strings ${CFLAGS} 11 ldflags = ${LDFLAGS} 12 13 all: ${name} 14 15 .c.o: 16 ${cc} ${cflags} -c -o $@ $< 17 18 ${obj}: ${objprereq} 19 20 ${name}: ${obj} 21 ${cc} -o $@ ${obj} ${ldflags} 22 23 clean: 24 rm -f ${name} ${obj} 25 26 install: ${name} 27 cp -f ${name} ${prefix}/bin 28 cp -f ${name}.1 ${manprefix}/man1 29 30 uninstall: 31 rm -f ${prefix}/bin/${name} 32 rm -f ${manprefix}/man1/${name}.1 33 34 .SUFFIXES: .c .o 35 .PHONY: clean install uninstall