xref: /freebsd/usr.sbin/acpi/iasl/Makefile (revision 5b56413d04e608379c9a306373554a8e4d321bc0)
1PROG=	iasl
2
3# common
4SRCS=	acfileio.c adfile.c adisasm.c adwalk.c ahids.c		\
5	ahpredef.c ahtable.c ahuuids.c cmfsize.c dmextern.c	\
6	dmrestag.c dmswitch.c dmtable.c dmtables.c dmtbdump.c	\
7	dmtbdump1.c dmtbdump2.c dmtbdump3.c dmtbinfo.c		\
8	dmtbinfo1.c dmtbinfo2.c dmtbinfo3.c getopt.c
9
10# compiler
11SRCS+=	aslallocate.c aslanalyze.c aslascii.c aslbtypes.c	\
12	aslcache.c aslcodegen.c aslcompile.c aslcompiler.y.h	\
13	aslcompilerlex.c aslcompilerparse.c asldebug.c		\
14	aslerror.c aslexternal.c aslfileio.c aslfiles.c		\
15	aslfold.c aslhelp.c aslhex.c asllength.c asllisting.c	\
16	asllistsup.c aslload.c asllookup.c aslmain.c aslmap.c	\
17	aslmapenter.c aslmapoutput.c aslmaputils.c		\
18	aslmessages.c aslmethod.c aslnamesp.c asloffset.c	\
19	aslopcodes.c asloperands.c aslopt.c asloptions.c	\
20	aslparseop.c aslpld.c aslpredef.c aslprepkg.c		\
21	aslprintf.c aslprune.c aslresource.c aslrestype1.c	\
22	aslrestype1i.c aslrestype2.c aslrestype2d.c		\
23	aslrestype2e.c aslrestype2q.c aslrestype2s.c		\
24	aslrestype2w.c aslstartup.c aslstubs.c asltransform.c	\
25	asltree.c aslutils.c asluuid.c aslwalks.c aslxref.c	\
26	aslxrefout.c cvcompiler.c cvdisasm.c cvparser.c		\
27	dtcompile.c dtcompilerparser.y.h dtcompilerparserlex.c	\
28	dtcompilerparserparse.c dtexpress.c dtfield.c dtio.c	\
29	dtparser.y.h dtparserlex.c dtparserparse.c dtsubtable.c	\
30	dttable.c dttable1.c dttable2.c dttemplate.c dtutils.c	\
31	prexpress.c prmacros.c prparser.y.h prparserlex.c	\
32	prparserparse.c prscan.c prutils.c
33
34# components/debugger
35SRCS+=	dbfileio.c
36
37# components/disassembler
38SRCS+=	dmbuffer.c dmcstyle.c dmdeferred.c dmnames.c dmopcode.c	\
39	dmresrc.c dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c	\
40	dmwalk.c
41
42# components/dispatcher
43SRCS+=	dsargs.c dscontrol.c dsfield.c dsobject.c dsopcode.c	\
44	dspkginit.c dsutils.c dswexec.c dswload.c dswload2.c	\
45	dswscope.c dswstate.c
46
47# components/executer
48SRCS+=	exconcat.c exconvrt.c excreate.c exdump.c exmisc.c	\
49	exmutex.c exnames.c exoparg1.c exoparg2.c exoparg3.c	\
50	exoparg6.c exprep.c exresnte.c exresolv.c exresop.c	\
51	exstore.c exstoren.c exstorob.c exsystem.c exutils.c
52
53# components/parser
54SRCS+=	psargs.c psloop.c psobject.c psopcode.c psopinfo.c	\
55	psparse.c psscope.c pstree.c psutils.c pswalk.c
56
57# components/namespace
58SRCS+=	nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c	\
59	nsparse.c nssearch.c nsutils.c nswalk.c
60
61# components/tables
62SRCS+=	tbdata.c tbfadt.c tbinstal.c tbprint.c tbutils.c	\
63	tbxface.c tbxfload.c
64
65# components/utilities
66SRCS+=	utaddress.c utalloc.c utascii.c utbuffer.c utcache.c	\
67	utcksum.c utcopy.c utdebug.c utdecode.c utdelete.c	\
68	uterror.c utexcep.c utglobal.c uthex.c utinit.c		\
69	utlock.c utmath.c utmisc.c utmutex.c utnonansi.c	\
70	utobject.c utownerid.c utpredef.c utresdecode.c		\
71	utresrc.c utstate.c utstring.c utstrsuppt.c		\
72	utstrtoul64.c utuuid.c utxface.c utxferror.c
73
74# os_specific/service_layers
75SRCS+=	osunixxf.c
76
77WARNS?=	2
78
79MAN=	iasl.8
80
81CFLAGS+= -DACPI_ASL_COMPILER -I.
82CWARNFLAGS.aslrestype2s.c= ${NO_WUNUSED_BUT_SET_VARIABLE}
83CWARNFLAGS.dmextern.c= ${NO_WUNUSED_BUT_SET_VARIABLE}
84LFLAGS= -i -s
85DLFLAGS=-i
86YFLAGS= -d
87
88CLEANFILES= aslcompiler.y aslcompiler.y.h aslcompilerlex.c	\
89	aslcompilerparse.c aslcompilerparse.h			\
90	dtcompilerparser.y.h dtcompilerparserlex.c		\
91	dtcompilerparserparse.c	dtcompilerparserparse.h		\
92	dtparser.y.h dtparserlex.c dtparserparse.c		\
93	dtparserparse.h prparser.y.h prparserlex.c		\
94	prparserparse.c prparserparse.h
95
96PARSER=	aslcstyle.y aslhelpers.y aslkeywords.y aslparser.y	\
97	aslprimaries.y aslresources.y aslrules.y aslsupport.y	\
98	asltokens.y asltypes.y
99
100aslcompilerlex.c: aslcompiler.l aslsupport.l
101	${LEX} ${LFLAGS} -PAslCompiler -o${.TARGET} \
102	    ${ACPICA_DIR}/compiler/aslcompiler.l
103
104aslcompiler.y: ${PARSER}
105	m4 -P -I${ACPICA_DIR}/compiler \
106	    ${ACPICA_DIR}/compiler/aslparser.y > ${.TARGET}
107
108.ORDER: aslcompilerparse.c aslcompilerparse.h
109aslcompilerparse.h: .NOMETA
110aslcompilerparse.c aslcompilerparse.h: aslcompiler.y
111	${YACC} ${YFLAGS} -pAslCompiler -oaslcompilerparse.c ${.ALLSRC}
112
113aslcompiler.y.h: aslcompilerparse.h .NOMETA
114	ln -f ${.ALLSRC} ${.TARGET}
115
116dtcompilerparserlex.c: dtcompilerparser.l
117	${LEX} ${DLFLAGS} -PDtCompilerParser -o${.TARGET} ${.ALLSRC}
118
119.ORDER: dtcompilerparserparse.c dtcompilerparserparse.h
120dtcompilerparserparse.h: .NOMETA
121dtcompilerparserparse.c dtcompilerparserparse.h: dtcompilerparser.y
122	${YACC} ${YFLAGS} -pDtCompilerParser -odtcompilerparserparse.c \
123	    ${.ALLSRC}
124
125dtcompilerparser.y.h: dtcompilerparserparse.h .NOMETA
126	ln -f ${.ALLSRC} ${.TARGET}
127
128dtparserlex.c: dtparser.l
129	${LEX} ${DLFLAGS} -PDtParser -o${.TARGET} ${.ALLSRC}
130
131.ORDER: dtparserparse.c dtparserparse.h
132dtparserparse.h: .NOMETA
133dtparserparse.c dtparserparse.h: dtparser.y
134	${YACC} ${YFLAGS} -pDtParser -odtparserparse.c ${.ALLSRC}
135
136dtparser.y.h: dtparserparse.h .NOMETA
137	ln -f ${.ALLSRC} ${.TARGET}
138
139prparserlex.c: prparser.l
140	${LEX} ${LFLAGS} -PPrParser -o${.TARGET} ${.ALLSRC}
141
142.ORDER: prparserparse.c prparserparse.h
143prparserparse.h: .NOMETA
144prparserparse.c prparserparse.h: prparser.y
145	${YACC} ${YFLAGS} -pPrParser -oprparserparse.c ${.ALLSRC}
146
147prparser.y.h: prparserparse.h .NOMETA
148	ln -f ${.ALLSRC} ${.TARGET}
149
150# AcpiUtInitStackPtrTrace intentionally leaks a pointer to an
151# on-stack variable.
152CWARNFLAGS.utdebug.c+= ${NO_WDANGLING_POINTER}
153
154.include <bsd.prog.mk>
155