Home | History | Annotate | Line # | Download | only in iasl
      1 # $NetBSD: Makefile,v 1.29 2025/08/28 15:46:22 christos Exp $
      2 
      3 .include <bsd.init.mk>
      4 
      5 .if ${HAVE_ACPI:Uno} == "yes"
      6 PROG=	iasl
      7 .endif
      8 BINDIR=	/usr/bin
      9 MAN=	iasl.8
     10 WARNS=	0
     11 TOPDIR=	${NETBSDSRCDIR}/sys/external/bsd/acpica/dist/compiler
     12 
     13 .include <bsd.own.mk>
     14 
     15 CPPFLAGS+=	-I${TOPDIR}/../include -I${TOPDIR} -I.
     16 CPPFLAGS+=	-DACPI_ASL_COMPILER -DACPI_USE_ALTERNATE_TIMEOUT
     17 .if ${MKREPRO:Uno} == "yes"
     18 CPPFLAGS+=	-DACPI_REPRO
     19 .endif
     20 LDADD+=		-ll -ly
     21 DPADD+=		${LIBL} ${LIBY}
     22 
     23 DPSRCS= aslcompilerparse.y aslcompilerlex.c aslcompilerparse.c \
     24 	dtparserparse.c dtparserlex.c prparserparse.c prparserlex.c \
     25 	dtcompilerparserparse.c dtcompilerparserlex.c
     26 
     27 .PATH:	${TOPDIR}
     28 SRCS+= \
     29 	adfile.c \
     30 	aslallocate.c \
     31 	aslanalyze.c \
     32 	aslascii.c \
     33 	aslbtypes.c \
     34 	aslcache.c \
     35 	aslcodegen.c \
     36 	aslcompile.c \
     37 	aslcompilerlex.c \
     38 	aslcompilerparse.c \
     39 	asldebug.c \
     40 	aslerror.c \
     41 	aslexternal.c \
     42 	aslfileio.c \
     43 	aslfiles.c \
     44 	aslfold.c \
     45 	aslhelp.c \
     46 	aslhex.c \
     47 	asllength.c \
     48 	asllisting.c \
     49 	asllistsup.c \
     50 	aslload.c \
     51 	asllookup.c \
     52 	aslmain.c \
     53 	aslmap.c \
     54 	aslmapenter.c \
     55 	aslmapoutput.c \
     56 	aslmaputils.c \
     57 	aslmessages.c \
     58 	aslmethod.c \
     59 	aslnamesp.c \
     60 	asloffset.c \
     61 	aslopcodes.c \
     62 	asloperands.c \
     63 	aslopt.c \
     64 	asloptions.c \
     65 	aslparseop.c \
     66 	aslpld.c \
     67 	aslpredef.c \
     68 	aslprepkg.c \
     69 	aslprintf.c \
     70 	aslprune.c \
     71 	aslresource.c \
     72 	aslrestype1.c \
     73 	aslrestype1i.c \
     74 	aslrestype2.c \
     75 	aslrestype2d.c \
     76 	aslrestype2e.c \
     77 	aslrestype2q.c \
     78 	aslrestype2s.c \
     79 	aslrestype2w.c \
     80 	aslstartup.c \
     81 	aslstubs.c \
     82 	asltransform.c \
     83 	asltree.c \
     84 	aslutils.c \
     85 	asluuid.c \
     86 	aslwalks.c \
     87 	aslxref.c \
     88 	aslxrefout.c \
     89 	cvcompiler.c \
     90 	cvdisasm.c \
     91 	cvparser.c \
     92 	dtcompile.c \
     93 	dtexpress.c \
     94 	dtfield.c \
     95 	dtio.c \
     96 	dtcompilerparserlex.c \
     97 	dtcompilerparserparse.c \
     98 	dtparserlex.c \
     99 	dtparserparse.c \
    100 	dtsubtable.c \
    101 	dttable.c \
    102 	dttable1.c \
    103 	dttable2.c \
    104 	dttemplate.c \
    105 	dtutils.c \
    106 	prexpress.c \
    107 	prmacros.c \
    108 	prparserlex.c \
    109 	prparserparse.c \
    110 	prscan.c \
    111 	prutils.c
    112 
    113 .PATH: ${TOPDIR}/../common
    114 SRCS+= \
    115 	acfileio.c \
    116 	adisasm.c \
    117 	adwalk.c \
    118 	ahids.c \
    119 	ahpredef.c \
    120 	ahtable.c \
    121 	ahuuids.c \
    122 	cmfsize.c \
    123 	dmextern.c \
    124 	dmrestag.c \
    125 	dmswitch.c \
    126 	dmtable.c \
    127 	dmtables.c \
    128 	dmtbdump.c \
    129 	dmtbdump1.c \
    130 	dmtbdump2.c \
    131 	dmtbdump3.c \
    132 	dmtbinfo.c \
    133 	dmtbinfo1.c \
    134 	dmtbinfo2.c \
    135 	dmtbinfo3.c \
    136 	getopt.c
    137 
    138 .PATH: ${TOPDIR}/../debugger
    139 SRCS+=  dbfileio.c
    140 
    141 .PATH: ${TOPDIR}/../disassembler
    142 SRCS+= \
    143 	dmbuffer.c \
    144 	dmcstyle.c \
    145 	dmdeferred.c \
    146 	dmnames.c \
    147 	dmopcode.c \
    148 	dmresrc.c \
    149 	dmresrcl.c \
    150 	dmresrcl2.c \
    151 	dmresrcs.c \
    152 	dmutils.c \
    153 	dmwalk.c
    154 
    155 .PATH: ${TOPDIR}/../dispatcher
    156 SRCS+= \
    157 	dsargs.c \
    158 	dscontrol.c \
    159 	dsfield.c \
    160 	dsobject.c \
    161 	dsopcode.c \
    162 	dspkginit.c \
    163 	dsutils.c \
    164 	dswexec.c \
    165 	dswload.c \
    166 	dswload2.c \
    167 	dswscope.c \
    168 	dswstate.c
    169 
    170 .PATH: ${TOPDIR}/../executer
    171 SRCS+= \
    172 	exconvrt.c \
    173 	excreate.c \
    174 	exconcat.c \
    175 	exdump.c \
    176 	exmisc.c \
    177 	exmutex.c \
    178 	exnames.c \
    179 	exoparg1.c \
    180 	exoparg2.c \
    181 	exoparg3.c \
    182 	exoparg6.c \
    183 	exprep.c \
    184 	exregion.c \
    185 	exresnte.c \
    186 	exresolv.c \
    187 	exresop.c \
    188 	exstore.c \
    189 	exstoren.c \
    190 	exstorob.c \
    191 	exsystem.c \
    192 	exutils.c
    193 
    194 .PATH: ${TOPDIR}/../parser
    195 SRCS+= \
    196 	psargs.c \
    197 	psloop.c \
    198 	psobject.c \
    199 	psopcode.c \
    200 	psopinfo.c \
    201 	psparse.c \
    202 	psscope.c \
    203 	pstree.c \
    204 	psutils.c \
    205 	pswalk.c
    206 
    207 .PATH: ${TOPDIR}/../tables
    208 SRCS+=	\
    209 	tbfadt.c \
    210 	tbdata.c \
    211 	tbinstal.c \
    212 	tbprint.c \
    213 	tbutils.c \
    214 	tbxface.c \
    215 	tbxfload.c
    216 
    217 .PATH: ${TOPDIR}/../namespace
    218 SRCS+= \
    219 	nsaccess.c \
    220 	nsalloc.c \
    221 	nsdump.c \
    222 	nsnames.c \
    223 	nsobject.c \
    224 	nsparse.c \
    225 	nssearch.c \
    226 	nsutils.c \
    227 	nswalk.c \
    228 	nsxfobj.c \
    229 
    230 .PATH: ${TOPDIR}/../utilities
    231 SRCS+= \
    232 	utaddress.c \
    233 	utalloc.c \
    234 	utascii.c \
    235 	utbuffer.c \
    236 	utcache.c \
    237 	utcksum.c \
    238 	utcopy.c \
    239 	utdebug.c \
    240 	utdecode.c \
    241 	utdelete.c \
    242 	uterror.c \
    243 	utexcep.c \
    244 	utglobal.c \
    245 	uthex.c \
    246 	utinit.c \
    247 	utlock.c \
    248 	utmath.c \
    249 	utmisc.c \
    250 	utmutex.c \
    251 	utnonansi.c \
    252 	utobject.c \
    253 	utosi.c \
    254 	utownerid.c \
    255 	utpredef.c \
    256 	utresdecode.c \
    257 	utresrc.c \
    258 	utstate.c \
    259 	utstring.c \
    260 	utstrsuppt.c \
    261 	utstrtoul64.c \
    262 	utuuid.c \
    263 	utxface.c \
    264 	utxferror.c
    265 
    266 #	utprint.c 
    267 
    268 .PATH: ${TOPDIR}/../os_specific/service_layers
    269 SRCS+=	osunixxf.c
    270 
    271 YHEADER=	# Generate headers
    272 YFLAGS+=-v	# Require debugging
    273 LFLAGS+=-i	# Case insensitivive parser
    274 
    275 
    276 # Prevent rules from firing.
    277 asltypes.h: asltypes.y
    278 	@true
    279 asltypes.c: asltypes.y
    280 	@true
    281 
    282 aslparser.y: asltokens.y asltypes.y aslrules.y aslsupport.y
    283 
    284 YPREFIX.aslcompilerparse.y=AslCompiler
    285 aslcompilerparse.y: aslparser.y
    286 	${TOOL_M4} -P -I${TOPDIR} ${.ALLSRC} > ${.TARGET}.tmp.${.MAKE.PID} \
    287 	&& mv ${.TARGET}.tmp.${.MAKE.PID} ${.TARGET}
    288 
    289 aslcompiler.y.h: aslcompilerparse.h
    290 	ln -sf ${.ALLSRC} ${.TARGET}
    291 
    292 LPREFIX.aslcompilerlex.l=AslCompiler
    293 aslcompilerlex.l: ${TOPDIR}/aslcompiler.l
    294 	ln -sf ${.ALLSRC} ${.TARGET}
    295 
    296 
    297 YPREFIX.dtparserparse.y=DtParser
    298 dtparserparse.y: ${TOPDIR}/dtparser.y
    299 	ln -sf ${.ALLSRC} ${.TARGET}
    300 
    301 dtparser.y.h: dtparserparse.h
    302 	ln -sf ${.ALLSRC} ${.TARGET}
    303 
    304 LPREFIX.dtparserlex.l=DtParser
    305 dtparserlex.l: ${TOPDIR}/dtparser.l
    306 	ln -sf ${.ALLSRC} ${.TARGET}
    307 
    308 YPREFIX.dtcompilerparserparse.y=DtCompilerParser
    309 YFLAGS.dtcompilerparserparse.y += -L
    310 dtcompilerparserparse.y: ${TOPDIR}/dtcompilerparser.y
    311 	ln -sf ${.ALLSRC} ${.TARGET}
    312 
    313 dtcompilerparser.y.h: dtcompilerparserparse.h
    314 	ln -sf ${.ALLSRC} ${.TARGET}
    315 
    316 LPREFIX.dtcompilerparserlex.l=DtCompilerParser
    317 LFLAGS.dtcompilerparserlex.l += --bison-locations
    318 dtcompilerparserlex.l: ${TOPDIR}/dtcompilerparser.l
    319 	ln -sf ${.ALLSRC} ${.TARGET}
    320 
    321 YPREFIX.prparserparse.y=PrParser
    322 prparserparse.y: ${TOPDIR}/prparser.y
    323 	ln -sf ${.ALLSRC} ${.TARGET}
    324 
    325 prparser.y.h: prparserparse.h
    326 	ln -sf ${.ALLSRC} ${.TARGET}
    327 
    328 LPREFIX.prparserlex.l=PrParser
    329 prparserlex.l: ${TOPDIR}/prparser.l
    330 	ln -sf ${.ALLSRC} ${.TARGET}
    331 
    332 CLEANFILES+=	aslcompilerparse.y  aslcompilerparse.c			\
    333 		aslcompilerparse.h					\
    334 		aslcompiler.y.h aslcompilerparse.output		 	\
    335 		aslcompilerlex.l aslcompilerlex.c			\
    336 									\
    337 		dtparserparse.y dtparserparse.c				\
    338 		dtparserparse.h						\
    339 		dtparserlex.l dtparserlex.c				\
    340 		dtparser.y.h dtparserparse.output			\
    341 									\
    342 		dtcompilerparserparse.y dtcompilerparserparse.c		\
    343 		dtcompilerparserparse.h					\
    344 		dtcompilerparserlex.l dtcompilerparserlex.c		\
    345 		dtcompilerparser.y.h dtcompilerparserparse.output	\
    346 									\
    347 		prparserparse.y prparserparse.c				\
    348 		prparserparse.h						\
    349 		prparserlex.l prparserlex.c				\
    350 		prparser.y.h prparserparse.output			\
    351 									\
    352 		y.output y.tab.h
    353 
    354 .include <bsd.prog.mk>
    355 
    356 ${__DPSRCS.d} ${OBJS}: prparser.y.h dtparser.y.h aslcompiler.y.h \
    357 	dtcompilerparser.y.h
    358 
    359 # ia64 compiler bug. acpi_table_header pointer is casted to ACPI_TABLE_RSDP
    360 # both structures have a Signature member,
    361 # sizeof(acpi_table_header->Signature) == 4
    362 # sizeof(ACPI_TABLE_RSDP->Signature) == 8
    363 # the compiler knows that it is 8 after the cast because a 
    364 # __CTASSERT(sizeof(ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Signature) == 8);
    365 # works, but then gets confused and thinks that we are trying to copy into 4.
    366 .if ${MACHINE} == "ia64"
    367 COPTS.dmtable.c += -Wno-error=stringop-overread
    368 COPTS.tbprint.c += -Wno-error=stringop-overread
    369 .endif
    370