]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - gnu/usr.bin/dtc/Makefile
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / gnu / usr.bin / dtc / Makefile
1 # $FreeBSD$
2
3 .include <bsd.own.mk>
4
5 DTCDIR= ${.CURDIR}/../../../contrib/dtc
6 LIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt
7 .PATH: ${DTCDIR} ${LIBFDTDIR}
8
9 PROG=   dtc
10
11 SRCS=   dtc.c checks.c fstree.c livetree.c treesource.c data.c \
12         flattree.c srcpos.c util.c \
13         fdt.c fdt_ro.c fdt_rw.c fdt_strerror.c \
14         fdt_sw.c fdt_wip.c ${DTCVERSIONFILE}
15
16 WARNS?= 2
17 CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${LIBFDTDIR}
18
19 VERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' ${DTCDIR}/Makefile
20 VERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile
21 VERSIONSUB!= awk '/^SUBLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile
22 VERSIONEXTRA=
23
24 DTCVERSION:=    ${VERSIONMAJ}.${VERSIONMIN}.${VERSIONSUB}${VERSIONEXTRA}
25 DTCVERSIONFILE:=        version_gen.h
26
27 MAN=
28
29 BISON=  yacc
30 LEX=    lex
31
32 OBJS+= dtc-parser.tab.o dtc-lexer.lex.o
33
34 CLEANFILES+= dtc-parser.tab.o dtc-lexer.lex.o dtc-parser.tab.c \
35                 dtc-parser.tab.h dtc-lexer.lex.c ${DTCVERSIONFILE}
36
37 ${DTCVERSIONFILE}:
38         @echo '#define DTC_VERSION "DTC ${DTCVERSION}"' > ${DTCVERSIONFILE}
39
40 dtc-parser.tab.o:       dtc-parser.tab.c dtc-parser.tab.h
41 dtc-lexer.lex.o:        dtc-lexer.lex.c dtc-parser.tab.h
42
43 dtc-parser.tab.c:       dtc-parser.y
44         ${BISON} -o$@ -d ${DTCDIR}/dtc-parser.y
45
46 dtc-parser.tab.h:       dtc-parser.tab.c
47
48 dtc-lexer.lex.c: dtc-lexer.l
49         ${LEX} -o$@ ${DTCDIR}/dtc-lexer.l
50
51 .include <bsd.prog.mk>