Makefile revision 204765
1204490Sraj# $FreeBSD: head/gnu/usr.bin/dtc/Makefile 204765 2010-03-05 19:51:02Z raj $ 2204490Sraj 3204490Sraj.include <bsd.own.mk> 4204490Sraj 5204490SrajDTCDIR= ${.CURDIR}/../../../contrib/dtc 6204490SrajLIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt 7204765Sraj.PATH: ${DTCDIR} ${LIBFDTDIR} 8204490Sraj 9204490SrajPROG= dtc 10204490Sraj 11204490SrajSRCS= dtc.c checks.c fstree.c livetree.c treesource.c data.c \ 12204490Sraj flattree.c srcpos.c util.c \ 13204490Sraj fdt.c fdt_ro.c fdt_rw.c fdt_strerror.c \ 14204490Sraj fdt_sw.c fdt_wip.c $(DTCDIR)/version_gen.h 15204490Sraj 16204490SrajCFLAGS = -Wall -g -Os -fPIC -Wpointer-arith -Wcast-qual 17204490SrajCFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${LIBFDTDIR} 18204490Sraj 19204490SrajVERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' $(DTCDIR)/Makefile 20204490SrajVERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' $(DTCDIR)/Makefile 21204490SrajVERSIONSUB!= awk '/^SUBLEVEL =/ { print $$3 }' $(DTCDIR)/Makefile 22204490SrajVERSIONEXTRA!= $(DTCDIR)/scripts/setlocalversion 23204490Sraj 24204490SrajDTCVERSION:= ${VERSIONMAJ}.${VERSIONMIN}.${VERSIONSUB}${VERSIONEXTRA} 25204490SrajDTCVERSIONFILE:= $(DTCDIR)/version_gen.h 26204490Sraj 27204490SrajMAN= 28204490Sraj 29204490SrajBISON= yacc 30204490SrajLEX= lex 31204490Sraj 32204490SrajOBJS+= dtc-parser.tab.o dtc-lexer.lex.o 33204490Sraj 34204490SrajCLEANFILES+= dtc-parser.tab.o dtc-lexer.lex.o dtc-parser.tab.c \ 35204490Sraj dtc-parser.tab.h dtc-lexer.lex.c ${DTCVERSIONFILE} 36204490Sraj 37204490Sraj$(DTCVERSIONFILE): 38204490Sraj @echo '#define DTC_VERSION "DTC ${DTCVERSION}"' > ${DTCVERSIONFILE} 39204490Sraj 40204490Srajdtc-parser.tab.o: dtc-parser.tab.c dtc-parser.tab.h 41204490Srajdtc-lexer.lex.o: dtc-lexer.lex.c dtc-parser.tab.h 42204490Sraj 43204490Srajdtc-parser.tab.c: dtc-parser.y 44204490Sraj $(BISON) -o$@ -d $(DTCDIR)/dtc-parser.y 45204490Sraj 46204490Srajdtc-parser.tab.h: dtc-parser.tab.c 47204490Sraj 48204490Srajdtc-lexer.lex.c: dtc-lexer.l 49204490Sraj $(LEX) -o$@ $(DTCDIR)/dtc-lexer.l 50204490Sraj 51204490Sraj.include <bsd.prog.mk> 52