This is more correct
[dhcpcd-ui] / mk / prog.mk
1 # rules to build a program 
2 # based on FreeBSD's bsd.prog.mk
3
4 # Copyright 2008-2010 Roy Marples <roy@marples.name>
5
6 SRCS?=          ${PROG}.c
7 OBJS+=          ${SRCS:.c=.o}
8
9 all: ${PROG} ${SCRIPTS} ${FILES}
10
11 .c.o:
12         ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
13
14 ${PROG}: .depend ${OBJS}
15         ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
16
17 proginstall: ${PROG}
18         ${INSTALL} -d ${DESTDIR}${BINDIR}
19         ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}
20
21 include ${MKDIR}/sys.mk
22 include ${MKDIR}/depend.mk
23 include ${MKDIR}/man.mk
24
25 install: proginstall ${FILESINSTALL} _maninstall
26
27 clean:
28         rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}