48b9d4e2ccf29bb26f1fdd8d84d140cecfe7170c
[dhcpcd-ui] / mk / prog.mk
1 # rules to build a program 
2 # based on FreeBSD's bsd.prog.mk
3
4 # Copyright 2008 Roy Marples <roy@marples.name>
5
6 include ${MK}/cc.mk
7
8 SRCS?=          ${PROG}.c
9 OBJS+=          ${SRCS:.c=.o}
10
11 all: ${PROG} ${SCRIPTS}
12
13 .c.o:
14         ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
15
16 ${PROG}: .depend ${OBJS}
17         ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
18
19 _proginstall: ${PROG}
20         ${INSTALL} -d ${DESTDIR}${BINDIR}
21         ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}
22         ${INSTALL} -d ${DESTDIR}${DBDIR}
23
24 include ${MK}/depend.mk
25 include ${MK}/files.mk
26 include ${MK}/dist.mk
27
28 install: _proginstall _filesinstall
29
30 clean:
31         rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}