2010-02-28 23:09:09 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
DTCDIR= ${.CURDIR}/../../../contrib/dtc
|
|
|
|
LIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt
|
2010-03-05 20:51:02 +01:00
|
|
|
.PATH: ${DTCDIR} ${LIBFDTDIR}
|
2010-02-28 23:09:09 +01: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 15:27:55 +02:00
|
|
|
fdt_sw.c fdt_wip.c ${DTCVERSIONFILE}
|
2010-02-28 23:09:09 +01:00
|
|
|
|
|
|
|
CFLAGS = -Wall -g -Os -fPIC -Wpointer-arith -Wcast-qual
|
|
|
|
CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${LIBFDTDIR}
|
|
|
|
|
2010-05-25 15:27:55 +02: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 23:09:09 +01:00
|
|
|
|
|
|
|
DTCVERSION:= ${VERSIONMAJ}.${VERSIONMIN}.${VERSIONSUB}${VERSIONEXTRA}
|
2010-05-25 15:27:55 +02:00
|
|
|
DTCVERSIONFILE:= version_gen.h
|
2010-02-28 23:09:09 +01: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}
|
|
|
|
|
2010-05-25 15:27:55 +02:00
|
|
|
${DTCVERSIONFILE}:
|
2010-02-28 23:09:09 +01: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 15:27:55 +02:00
|
|
|
${BISON} -o$@ -d ${DTCDIR}/dtc-parser.y
|
2010-02-28 23:09:09 +01:00
|
|
|
|
|
|
|
dtc-parser.tab.h: dtc-parser.tab.c
|
|
|
|
|
|
|
|
dtc-lexer.lex.c: dtc-lexer.l
|
2010-05-25 15:27:55 +02:00
|
|
|
${LEX} -o$@ ${DTCDIR}/dtc-lexer.l
|
2010-02-28 23:09:09 +01:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|