2010-02-28 22:09:09 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
DTCDIR= ${.CURDIR}/../../../contrib/dtc
|
2015-12-01 22:20:04 +00:00
|
|
|
_LIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt
|
|
|
|
.PATH: ${DTCDIR} ${_LIBFDTDIR}
|
2010-02-28 22:09:09 +00:00
|
|
|
|
|
|
|
PROG= dtc
|
|
|
|
|
|
|
|
SRCS= dtc.c checks.c fstree.c livetree.c treesource.c data.c \
|
|
|
|
flattree.c srcpos.c util.c \
|
|
|
|
fdt.c fdt_ro.c fdt_rw.c fdt_strerror.c \
|
2010-05-25 13:27:55 +00:00
|
|
|
fdt_sw.c fdt_wip.c ${DTCVERSIONFILE}
|
2010-02-28 22:09:09 +00:00
|
|
|
|
2010-07-15 02:22:50 +00:00
|
|
|
WARNS?= 2
|
2015-12-01 22:20:04 +00:00
|
|
|
CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${_LIBFDTDIR}
|
2010-02-28 22:09:09 +00:00
|
|
|
|
2010-05-25 13:27:55 +00:00
|
|
|
VERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' ${DTCDIR}/Makefile
|
|
|
|
VERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile
|
|
|
|
VERSIONSUB!= awk '/^SUBLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile
|
|
|
|
VERSIONEXTRA=
|
2010-02-28 22:09:09 +00:00
|
|
|
|
|
|
|
DTCVERSION:= ${VERSIONMAJ}.${VERSIONMIN}.${VERSIONSUB}${VERSIONEXTRA}
|
2010-05-25 13:27:55 +00:00
|
|
|
DTCVERSIONFILE:= version_gen.h
|
2010-02-28 22:09:09 +00:00
|
|
|
|
|
|
|
MAN=
|
|
|
|
|
|
|
|
BISON= yacc
|
|
|
|
LEX= lex
|
|
|
|
|
|
|
|
OBJS+= dtc-parser.tab.o dtc-lexer.lex.o
|
|
|
|
|
|
|
|
CLEANFILES+= dtc-parser.tab.o dtc-lexer.lex.o dtc-parser.tab.c \
|
|
|
|
dtc-parser.tab.h dtc-lexer.lex.c ${DTCVERSIONFILE}
|
|
|
|
|
2017-03-10 17:37:55 +00:00
|
|
|
${DTCVERSIONFILE}: ${DTCDIR}/Makefile
|
2010-02-28 22:09:09 +00:00
|
|
|
@echo '#define DTC_VERSION "DTC ${DTCVERSION}"' > ${DTCVERSIONFILE}
|
|
|
|
|
|
|
|
dtc-parser.tab.o: dtc-parser.tab.c dtc-parser.tab.h
|
|
|
|
dtc-lexer.lex.o: dtc-lexer.lex.c dtc-parser.tab.h
|
|
|
|
|
|
|
|
dtc-parser.tab.c: dtc-parser.y
|
2010-05-25 13:27:55 +00:00
|
|
|
${BISON} -o$@ -d ${DTCDIR}/dtc-parser.y
|
2010-02-28 22:09:09 +00:00
|
|
|
|
|
|
|
dtc-parser.tab.h: dtc-parser.tab.c
|
|
|
|
|
|
|
|
dtc-lexer.lex.c: dtc-lexer.l
|
2010-05-25 13:27:55 +00:00
|
|
|
${LEX} -o$@ ${DTCDIR}/dtc-lexer.l
|
2010-02-28 22:09:09 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|