1# $NetBSD: Makefile,v 1.4.4.1 2012/02/24 17:18:58 riz Exp $
2
3.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64")
4PROG=	iasl
5.endif
6BINDIR=	/usr/bin
7MAN=	iasl.8
8WARNS=	0
9TOPDIR=	${NETBSDSRCDIR}/sys/external/bsd/acpica/dist/compiler
10
11.include <bsd.own.mk>
12
13CPPFLAGS+=	-I${TOPDIR}/../include -I${TOPDIR} -I.
14CPPFLAGS+=	-D__NetBSD__ -DACPI_ASL_COMPILER -DACPI_USE_ALTERNATE_TIMEOUT
15CPPFLAGS+=	-D_USE_BERKELEY_YACC
16.if ${MKREPRO:Uno} == "yes"
17CPPFLAGS+=	-DACPI_REPRO
18.endif
19LDADD+=		-ll -ly -lrt -lpthread
20DPADD+=		${LIBL} ${LIBY} ${LIBRT} ${LIBPTHREAD}
21
22DPSRCS= aslcompilerparse.c aslcompilerlex.c \
23	dtparserparse.c dtparserlex.c
24
25.PATH:	${TOPDIR}
26SRCS+=  aslcompilerparse.c aslcompilerlex.c adfile.c \
27	aslanalyze.c aslbtypes.c aslcodegen.c aslcompile.c      \
28	aslerror.c aslfiles.c aslfold.c asllength.c             \
29	asllisting.c aslload.c asllookup.c aslmain.c aslmap.c   \
30	aslopcodes.c asloperands.c aslopt.c aslpredef.c         \
31	aslresource.c aslrestype1.c aslrestype1i.c              \
32	aslrestype2.c aslrestype2d.c aslrestype2e.c             \
33	aslrestype2q.c aslrestype2w.c aslstartup.c aslstubs.c   \
34	asltransform.c asltree.c aslutils.c asluuid.c           \
35	aslwalks.c dtcompile.c dtexpress.c dtfield.c dtio.c     \
36	dtparserparse.c dtparserlex.c				\
37	dtsubtable.c dttable.c dttemplate.c dtutils.c
38
39.PATH: ${TOPDIR}/../common
40SRCS+=  adisasm.c adwalk.c dmextern.c dmrestag.c dmtable.c \
41	dmtbdump.c dmtbinfo.c getopt.c
42
43.PATH: ${TOPDIR}/../debugger
44SRCS+=  dbfileio.c
45
46.PATH: ${TOPDIR}/../disassembler
47SRCS+=  dmbuffer.c dmnames.c dmobject.c dmopcode.c dmresrc.c    \
48	dmresrcl.c dmresrcs.c dmutils.c dmwalk.c
49
50.PATH: ${TOPDIR}/../dispatcher
51SRCS+=  dsargs.c dscontrol.c dsfield.c dsobject.c dsopcode.c    \
52	dsutils.c dswexec.c dswload.c dswload2.c dswscope.c     \
53	dswstate.c
54
55.PATH: ${TOPDIR}/../executer
56SRCS+=  exconvrt.c excreate.c exdump.c exmisc.c exmutex.c       \
57	exnames.c exoparg1.c exoparg2.c exoparg3.c exoparg6.c   \
58	exprep.c exregion.c exresnte.c exresolv.c exresop.c     \
59	exstore.c exstoren.c exstorob.c exsystem.c exutils.c
60
61.PATH: ${TOPDIR}/../parser
62SRCS+=  psargs.c psloop.c psopcode.c psparse.c psscope.c        \
63	pstree.c psutils.c pswalk.c
64
65.PATH: ${TOPDIR}/../tables
66SRCS+=	tbfadt.c tbinstal.c tbutils.c tbxface.c
67
68.PATH: ${TOPDIR}/../namespace
69SRCS+=  nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c      \
70	nsparse.c nssearch.c nsutils.c nswalk.c nsxfobj.c
71
72.PATH: ${TOPDIR}/../utilities
73SRCS+=  utalloc.c utcache.c utcopy.c utdebug.c utdecode.c       \
74	utdelete.c utglobal.c utinit.c utlock.c utmath.c        \
75	utmisc.c utmutex.c utobject.c utosi.c utresrc.c         \
76	utstate.c utxface.c utxferror.c
77
78.PATH: ${TOPDIR}/../os_specific/service_layers
79SRCS+=	osunixxf.c
80
81aslcompilerparse.c: ${TOPDIR}/aslcompiler.y
82	${YACC} -v -d -o${.TARGET} -pAslCompiler ${.ALLSRC}
83	mv -f ${.PREFIX}.h aslcompiler.y.h
84
85aslcompilerlex.c: ${TOPDIR}/aslcompiler.l
86	${LEX} -i -PAslCompiler -o${.TARGET} ${.ALLSRC}
87
88dtparserparse.c: ${TOPDIR}/dtparser.y
89	${YACC} -v -d -o${.TARGET} -pDtParser ${.ALLSRC}
90	mv -f ${.PREFIX}.h dtparser.y.h
91
92dtparserlex.c: ${TOPDIR}/dtparser.l
93	${LEX} -i -PDtParser -o${.TARGET} ${.ALLSRC}
94
95CLEANFILES+=	aslcompilerlex.c aslcompilerparse.c	\
96		aslcompiler.y.h aslcompilerparse.output \
97		dtparserlex.c dtparserparse.c		\
98		dtparser.y.h dtparserparse.output
99
100.include <bsd.prog.mk>
101