diff options
author | raj <raj@FreeBSD.org> | 2010-02-28 22:09:09 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2010-02-28 22:09:09 +0000 |
commit | 956aefe4c546e33c21f138c807f8a9b5a4a41f3b (patch) | |
tree | 3c9f7effd33c802448f68684ea0e643ef554b20f /gnu/usr.bin/dtc | |
parent | 56fbcd5e03cd7871fe5106e14c334e75f6d902e8 (diff) | |
download | FreeBSD-src-956aefe4c546e33c21f138c807f8a9b5a4a41f3b.zip FreeBSD-src-956aefe4c546e33c21f138c807f8a9b5a4a41f3b.tar.gz |
Provide BSD-style Makefile for the device tree compiler (dtc).
Note it is not connected to the build hierarchy yet.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'gnu/usr.bin/dtc')
-rw-r--r-- | gnu/usr.bin/dtc/Makefile | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gnu/usr.bin/dtc/Makefile b/gnu/usr.bin/dtc/Makefile new file mode 100644 index 0000000..3bab94e --- /dev/null +++ b/gnu/usr.bin/dtc/Makefile @@ -0,0 +1,51 @@ +# $FreeBSD$ + +.include <bsd.own.mk> + +DTCDIR= ${.CURDIR}/../../../contrib/dtc +LIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt +.PATH: ${DTCDIR} ${LIBFDTDIR} ${DTCDIR}/tests + +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 \ + fdt_sw.c fdt_wip.c $(DTCDIR)/version_gen.h + +CFLAGS = -Wall -g -Os -fPIC -Wpointer-arith -Wcast-qual +CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${LIBFDTDIR} + +VERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' $(DTCDIR)/Makefile +VERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' $(DTCDIR)/Makefile +VERSIONSUB!= awk '/^SUBLEVEL =/ { print $$3 }' $(DTCDIR)/Makefile +VERSIONEXTRA!= $(DTCDIR)/scripts/setlocalversion + +DTCVERSION:= ${VERSIONMAJ}.${VERSIONMIN}.${VERSIONSUB}${VERSIONEXTRA} +DTCVERSIONFILE:= $(DTCDIR)/version_gen.h + +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} + +$(DTCVERSIONFILE): + @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 + $(BISON) -o$@ -d $(DTCDIR)/dtc-parser.y + +dtc-parser.tab.h: dtc-parser.tab.c + +dtc-lexer.lex.c: dtc-lexer.l + $(LEX) -o$@ $(DTCDIR)/dtc-lexer.l + +.include <bsd.prog.mk> |