2010-06-12 00:22:39 +04:00
|
|
|
#
|
|
|
|
# iASL compiler/disassembler
|
2011-06-02 01:29:54 +04:00
|
|
|
#
|
|
|
|
# NOTE: This makefile is intended to be used in the Linux environment,
|
|
|
|
# with the Linux directory structure. It will not work directly
|
|
|
|
# on the native ACPICA source tree.
|
|
|
|
#
|
2011-06-10 21:36:49 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Configuration
|
|
|
|
# Notes:
|
|
|
|
# gcc should be version 4 or greater, otherwise some of the options
|
|
|
|
# used will not be recognized.
|
|
|
|
# Global optimization flags (such as -O2, -Os) are not used, since
|
|
|
|
# they cause issues on some compilers.
|
|
|
|
# The _GNU_SOURCE symbol is required for many hosts.
|
|
|
|
#
|
2011-06-04 01:19:27 +04:00
|
|
|
PROG = iasl
|
2010-06-12 00:22:39 +04:00
|
|
|
|
2011-06-10 21:36:49 +04:00
|
|
|
HOST = _LINUX
|
|
|
|
NOMAN = YES
|
2011-08-20 00:45:04 +04:00
|
|
|
COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
|
2011-06-10 21:36:49 +04:00
|
|
|
|
|
|
|
ACPICA_COMPONENTS =
|
2011-08-20 00:45:04 +04:00
|
|
|
ACPICA_SRC = ..
|
|
|
|
ACPICA_INCLUDE = $(ACPICA_SRC)/include
|
|
|
|
ACPICA_COMMON = $(ACPICA_SRC)/common
|
|
|
|
ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS)
|
|
|
|
ACPICA_TOOLS = $(ACPICA_SRC)/tools
|
|
|
|
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
|
|
|
|
ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
|
|
|
|
ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
|
|
|
|
ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
|
|
|
|
ACPICA_EXECUTER = $(ACPICA_CORE)/executer
|
|
|
|
ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
|
|
|
|
ACPICA_PARSER = $(ACPICA_CORE)/parser
|
|
|
|
ACPICA_TABLES = $(ACPICA_CORE)/tables
|
|
|
|
ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
|
|
|
|
ASL_COMPILER = $(ACPICA_SRC)/compiler
|
|
|
|
INSTALLDIR = /usr/bin
|
|
|
|
INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
|
|
|
|
|
|
|
|
ACPICA_HEADERS = \
|
|
|
|
$(wildcard $(ACPICA_INCLUDE)/*.h) \
|
|
|
|
$(wildcard $(ACPICA_INCLUDE)/platform/*.h)
|
2005-06-29 10:17:17 +04:00
|
|
|
|
2010-06-12 00:22:39 +04:00
|
|
|
#
|
2011-08-20 00:45:04 +04:00
|
|
|
# Search paths for source files
|
2010-06-12 00:22:39 +04:00
|
|
|
#
|
2011-08-20 00:45:04 +04:00
|
|
|
vpath %.c \
|
|
|
|
$(ASL_COMPILER) \
|
|
|
|
$(ACPICA_DEBUGGER) \
|
|
|
|
$(ACPICA_DISASSEMBLER) \
|
|
|
|
$(ACPICA_DISPATCHER) \
|
|
|
|
$(ACPICA_EXECUTER) \
|
|
|
|
$(ACPICA_NAMESPACE) \
|
|
|
|
$(ACPICA_PARSER) \
|
|
|
|
$(ACPICA_TABLES) \
|
|
|
|
$(ACPICA_UTILITIES) \
|
|
|
|
$(ACPICA_COMMON) \
|
|
|
|
$(ACPICA_OSL)
|
|
|
|
|
|
|
|
HEADERS = \
|
|
|
|
$(wildcard $(ASL_COMPILER)/*.h) \
|
|
|
|
aslcompiler.y.h \
|
|
|
|
dtparser.y.h
|
|
|
|
|
|
|
|
OBJECTS = \
|
|
|
|
aslcompilerlex.o \
|
|
|
|
aslcompilerparse.o \
|
|
|
|
dtparserlex.o \
|
|
|
|
dtparserparse.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
adfile.o \
|
|
|
|
adisasm.o \
|
|
|
|
adwalk.o \
|
|
|
|
aslanalyze.o \
|
2011-02-02 00:10:47 +03:00
|
|
|
aslbtypes.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
aslcodegen.o \
|
|
|
|
aslcompile.o \
|
|
|
|
aslerror.o \
|
|
|
|
aslfiles.o \
|
|
|
|
aslfold.o \
|
|
|
|
asllength.o \
|
|
|
|
asllisting.o \
|
|
|
|
aslload.o \
|
|
|
|
asllookup.o \
|
|
|
|
aslmain.o \
|
|
|
|
aslmap.o \
|
|
|
|
aslopcodes.o \
|
|
|
|
asloperands.o \
|
|
|
|
aslopt.o \
|
|
|
|
aslpredef.o \
|
|
|
|
aslresource.o \
|
|
|
|
aslrestype1.o \
|
|
|
|
aslrestype1i.o \
|
|
|
|
aslrestype2.o \
|
|
|
|
aslrestype2d.o \
|
|
|
|
aslrestype2e.o \
|
2011-11-09 15:16:10 +04:00
|
|
|
aslrestype2s.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
aslrestype2q.o \
|
|
|
|
aslrestype2w.o \
|
|
|
|
aslstartup.o \
|
|
|
|
aslstubs.o \
|
|
|
|
asltransform.o \
|
|
|
|
asltree.o \
|
|
|
|
aslutils.o \
|
2011-01-12 01:44:08 +03:00
|
|
|
asluuid.o \
|
2011-02-02 00:10:47 +03:00
|
|
|
aslwalks.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
dtcompile.o \
|
2011-01-21 19:42:11 +03:00
|
|
|
dtexpress.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
dtfield.o \
|
|
|
|
dtio.o \
|
|
|
|
dtsubtable.o \
|
|
|
|
dttable.o \
|
|
|
|
dttemplate.o \
|
|
|
|
dtutils.o \
|
|
|
|
dbfileio.o \
|
|
|
|
dmbuffer.o \
|
|
|
|
dmextern.o \
|
|
|
|
dmnames.o \
|
|
|
|
dmobject.o \
|
|
|
|
dmopcode.o \
|
|
|
|
dmresrc.o \
|
|
|
|
dmresrcl.o \
|
2011-11-09 16:02:00 +04:00
|
|
|
dmresrcl2.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
dmresrcs.o \
|
|
|
|
dmrestag.o \
|
|
|
|
dmtable.o \
|
|
|
|
dmtbdump.o \
|
|
|
|
dmtbinfo.o \
|
|
|
|
dmutils.o \
|
|
|
|
dmwalk.o \
|
2011-01-27 21:28:18 +03:00
|
|
|
dsargs.o \
|
|
|
|
dscontrol.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
dsfield.o \
|
|
|
|
dsobject.o \
|
|
|
|
dsopcode.o \
|
|
|
|
dsutils.o \
|
|
|
|
dswexec.o \
|
|
|
|
dswload.o \
|
2011-01-27 21:28:18 +03:00
|
|
|
dswload2.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
dswscope.o \
|
|
|
|
dswstate.o \
|
|
|
|
exconvrt.o \
|
|
|
|
excreate.o \
|
|
|
|
exdump.o \
|
|
|
|
exmisc.o \
|
|
|
|
exmutex.o \
|
|
|
|
exnames.o \
|
|
|
|
exoparg1.o \
|
|
|
|
exoparg2.o \
|
|
|
|
exoparg3.o \
|
|
|
|
exoparg6.o \
|
|
|
|
exprep.o \
|
|
|
|
exregion.o \
|
|
|
|
exresnte.o \
|
|
|
|
exresolv.o \
|
|
|
|
exresop.o \
|
|
|
|
exstore.o \
|
|
|
|
exstoren.o \
|
|
|
|
exstorob.o \
|
|
|
|
exsystem.o \
|
|
|
|
exutils.o \
|
|
|
|
getopt.o \
|
|
|
|
nsaccess.o \
|
|
|
|
nsalloc.o \
|
|
|
|
nsdump.o \
|
|
|
|
nsnames.o \
|
|
|
|
nsobject.o \
|
|
|
|
nsparse.o \
|
|
|
|
nssearch.o \
|
|
|
|
nsutils.o \
|
|
|
|
nswalk.o \
|
|
|
|
nsxfobj.o \
|
|
|
|
osunixxf.o \
|
|
|
|
psargs.o \
|
|
|
|
psloop.o \
|
|
|
|
psopcode.o \
|
|
|
|
psparse.o \
|
|
|
|
psscope.o \
|
|
|
|
pstree.o \
|
|
|
|
psutils.o \
|
|
|
|
pswalk.o \
|
|
|
|
tbfadt.o \
|
|
|
|
tbinstal.o \
|
|
|
|
tbutils.o \
|
|
|
|
tbxface.o \
|
|
|
|
utalloc.o \
|
|
|
|
utcache.o \
|
|
|
|
utcopy.o \
|
|
|
|
utdebug.o \
|
2011-01-22 02:10:19 +03:00
|
|
|
utdecode.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
utdelete.o \
|
|
|
|
utglobal.o \
|
|
|
|
utinit.o \
|
|
|
|
utlock.o \
|
|
|
|
utmath.o \
|
|
|
|
utmisc.o \
|
|
|
|
utmutex.o \
|
|
|
|
utobject.o \
|
|
|
|
utresrc.o \
|
|
|
|
utstate.o \
|
2010-09-10 23:48:36 +04:00
|
|
|
utxferror.o \
|
2010-06-12 00:22:39 +04:00
|
|
|
utxface.o
|
2005-06-29 10:17:17 +04:00
|
|
|
|
2010-06-12 00:22:39 +04:00
|
|
|
INTERMEDIATES = \
|
|
|
|
aslcompilerlex.c \
|
2011-04-15 21:03:35 +04:00
|
|
|
aslcompilerparse.c \
|
|
|
|
dtparserlex.c \
|
|
|
|
dtparserparse.c
|
2005-06-29 10:17:17 +04:00
|
|
|
|
2010-06-12 00:22:39 +04:00
|
|
|
MISC = \
|
2011-08-20 00:45:04 +04:00
|
|
|
aslcompilerparse.h \
|
2010-06-12 00:22:39 +04:00
|
|
|
aslcompiler.y.h \
|
2011-04-15 21:03:35 +04:00
|
|
|
aslcompilerparse.output \
|
2011-08-20 00:45:04 +04:00
|
|
|
dtparserparse.h \
|
2011-04-15 21:03:35 +04:00
|
|
|
dtparser.y.h \
|
|
|
|
dtparserparse.output
|
2010-06-12 00:22:39 +04:00
|
|
|
|
2011-08-20 00:45:04 +04:00
|
|
|
CFLAGS+= \
|
|
|
|
-D$(HOST) \
|
|
|
|
-D_GNU_SOURCE \
|
|
|
|
-DACPI_ASL_COMPILER \
|
|
|
|
-I$(ACPICA_INCLUDE) \
|
|
|
|
-I$(ASL_COMPILER)
|
|
|
|
|
|
|
|
CWARNINGFLAGS = \
|
|
|
|
-ansi \
|
|
|
|
-Wall \
|
|
|
|
-Wbad-function-cast \
|
|
|
|
-Wdeclaration-after-statement \
|
|
|
|
-Werror \
|
|
|
|
-Wformat=2 \
|
|
|
|
-Wmissing-declarations \
|
|
|
|
-Wmissing-prototypes \
|
|
|
|
-Wstrict-aliasing=0 \
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Wswitch-default \
|
|
|
|
-Wpointer-arith \
|
|
|
|
-Wundef
|
2010-06-12 00:22:39 +04:00
|
|
|
|
|
|
|
#
|
2011-08-20 00:45:04 +04:00
|
|
|
# gcc 4+ flags
|
2010-06-12 00:22:39 +04:00
|
|
|
#
|
2011-08-20 00:45:04 +04:00
|
|
|
CWARNINGFLAGS += \
|
|
|
|
-Waddress \
|
|
|
|
-Waggregate-return \
|
|
|
|
-Wchar-subscripts \
|
|
|
|
-Wempty-body \
|
|
|
|
-Wlogical-op \
|
|
|
|
-Wmissing-declarations \
|
|
|
|
-Wmissing-field-initializers \
|
|
|
|
-Wmissing-parameter-type \
|
|
|
|
-Wnested-externs \
|
|
|
|
-Wold-style-declaration \
|
|
|
|
-Wold-style-definition \
|
|
|
|
-Wredundant-decls \
|
|
|
|
-Wtype-limits
|
2010-06-12 00:22:39 +04:00
|
|
|
|
2011-08-20 00:45:04 +04:00
|
|
|
#
|
|
|
|
# Bison/Flex configuration
|
|
|
|
#
|
|
|
|
YACC= bison
|
|
|
|
YFLAGS+= -v -d -y
|
|
|
|
|
|
|
|
LEX= flex
|
|
|
|
LFLAGS+= -i -s
|
|
|
|
|
|
|
|
#
|
|
|
|
# Root rule
|
|
|
|
#
|
|
|
|
$(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS)
|
|
|
|
$(CC) $(OBJECTS) $(LDFLAGS) -o $(PROG)
|
2010-06-12 00:22:39 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Parser and Lexer - intermediate C files
|
|
|
|
#
|
|
|
|
aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l
|
2011-04-08 23:27:17 +04:00
|
|
|
${LEX} ${LFLAGS} -PAslCompiler -o$@ $?
|
2010-06-12 00:22:39 +04:00
|
|
|
|
2011-08-20 00:45:04 +04:00
|
|
|
aslcompilerparse.c aslcompilerparse.h : $(ASL_COMPILER)/aslcompiler.y
|
2011-04-08 23:27:17 +04:00
|
|
|
${YACC} ${YFLAGS} -pAslCompiler -o$@ $?
|
2010-06-12 00:22:39 +04:00
|
|
|
|
2011-04-08 23:27:17 +04:00
|
|
|
dtparserlex.c : $(ASL_COMPILER)/dtparser.l
|
|
|
|
${LEX} ${LFLAGS} -PDtParser -o$@ $?
|
|
|
|
|
2011-08-20 00:45:04 +04:00
|
|
|
dtparserparse.c dtparserparse.h : $(ASL_COMPILER)/dtparser.y
|
2011-04-08 23:27:17 +04:00
|
|
|
${YACC} ${YFLAGS} -pDtParser -o$@ $?
|
2011-08-20 00:45:04 +04:00
|
|
|
|
|
|
|
# Rename headers produced by bison/yacc
|
|
|
|
|
|
|
|
dtparser.y.h: dtparserparse.h
|
|
|
|
@echo Copy intermediate file:
|
|
|
|
@cp -f -v dtparserparse.h dtparser.y.h
|
|
|
|
|
|
|
|
aslcompiler.y.h : aslcompilerparse.h
|
|
|
|
@echo Copy intermediate file:
|
|
|
|
@cp -f -v aslcompilerparse.h aslcompiler.y.h
|
2011-04-08 23:27:17 +04:00
|
|
|
|
|
|
|
|
2010-06-12 00:22:39 +04:00
|
|
|
#
|
2011-04-08 23:27:17 +04:00
|
|
|
# Parsers and Lexers - final object files
|
2010-06-12 00:22:39 +04:00
|
|
|
#
|
|
|
|
# Cannot use the common compile warning flags since the C files are created
|
|
|
|
# by the utilities above and they are not necessarily ANSI C, etc.
|
|
|
|
#
|
|
|
|
aslcompilerlex.o : aslcompilerlex.c
|
2011-06-04 01:19:27 +04:00
|
|
|
$(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
|
2010-06-12 00:22:39 +04:00
|
|
|
|
|
|
|
aslcompilerparse.o : aslcompilerparse.c
|
2011-06-04 01:19:27 +04:00
|
|
|
$(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
|
2010-06-12 00:22:39 +04:00
|
|
|
|
2011-04-08 23:27:17 +04:00
|
|
|
dtparserlex.o : dtparserlex.c
|
2011-06-04 01:19:27 +04:00
|
|
|
$(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
|
2011-04-08 23:27:17 +04:00
|
|
|
|
|
|
|
dtparserparse.o : dtparserparse.c
|
2011-06-04 01:19:27 +04:00
|
|
|
$(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
|
2011-04-08 23:27:17 +04:00
|
|
|
|
2010-06-12 00:22:39 +04:00
|
|
|
|
2011-08-20 00:45:04 +04:00
|
|
|
%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
|
2010-06-12 00:22:39 +04:00
|
|
|
$(COMPILE)
|
|
|
|
|
2011-06-04 01:19:27 +04:00
|
|
|
clean :
|
2011-08-20 00:45:04 +04:00
|
|
|
rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC)
|
2011-06-04 01:19:27 +04:00
|
|
|
|
|
|
|
install :
|
|
|
|
$(INSTALLPROG)
|