5 DTCDIR= ${.CURDIR}/../../../contrib/dtc
6 LIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt
7 .PATH: ${DTCDIR} ${LIBFDTDIR}
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}
17 CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${LIBFDTDIR}
19 VERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' ${DTCDIR}/Makefile
20 VERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile
21 VERSIONSUB!= awk '/^SUBLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile
24 DTCVERSION:= ${VERSIONMAJ}.${VERSIONMIN}.${VERSIONSUB}${VERSIONEXTRA}
25 DTCVERSIONFILE:= version_gen.h
32 OBJS+= dtc-parser.tab.o dtc-lexer.lex.o
34 CLEANFILES+= dtc-parser.tab.o dtc-lexer.lex.o dtc-parser.tab.c \
35 dtc-parser.tab.h dtc-lexer.lex.c ${DTCVERSIONFILE}
38 @echo '#define DTC_VERSION "DTC ${DTCVERSION}"' > ${DTCVERSIONFILE}
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
43 dtc-parser.tab.c: dtc-parser.y
44 ${BISON} -o$@ -d ${DTCDIR}/dtc-parser.y
46 dtc-parser.tab.h: dtc-parser.tab.c
48 dtc-lexer.lex.c: dtc-lexer.l
49 ${LEX} -o$@ ${DTCDIR}/dtc-lexer.l
51 .include <bsd.prog.mk>