2 # iASL compiler/disassembler
4 # NOTE: This makefile is intended to be used within the native
11 # gcc should be version 4 or greater, otherwise some of the options
12 # used will not be recognized.
13 # Global optimization flags (such as -O2, -Os) are not used, since
14 # they cause issues on some compilers.
15 # The _GNU_SOURCE symbol is required for many hosts.
21 COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
23 ACPICA_SRC = ../../source
24 ACPICA_COMMON = $(ACPICA_SRC)/common
25 ACPICA_TOOLS = $(ACPICA_SRC)/tools
26 ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
27 ACPICA_CORE = $(ACPICA_SRC)/components
28 ACPICA_INCLUDE = $(ACPICA_SRC)/include
29 ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
30 ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
31 ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
32 ACPICA_EVENTS = $(ACPICA_CORE)/events
33 ACPICA_EXECUTER = $(ACPICA_CORE)/executer
34 ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
35 ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
36 ACPICA_PARSER = $(ACPICA_CORE)/parser
37 ACPICA_RESOURCES = $(ACPICA_CORE)/resources
38 ACPICA_TABLES = $(ACPICA_CORE)/tables
39 ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
40 ASL_COMPILER = $(ACPICA_SRC)/compiler
42 INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
45 $(wildcard $(ACPICA_INCLUDE)/*.h) \
46 $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
49 # Search paths for source files
54 $(ACPICA_DISASSEMBLER) \
55 $(ACPICA_DISPATCHER) \
65 $(wildcard $(ASL_COMPILER)/*.h) \
217 aslcompilerparse.output \
225 -DACPI_ASL_COMPILER \
226 -I$(ACPICA_INCLUDE) \
232 -Wbad-function-cast \
233 -Wdeclaration-after-statement \
236 -Wmissing-declarations \
237 -Wmissing-prototypes \
238 -Wstrict-aliasing=0 \
239 -Wstrict-prototypes \
253 -Wmissing-declarations \
254 -Wmissing-field-initializers \
255 -Wmissing-parameter-type \
257 -Wold-style-declaration \
258 -Wold-style-definition \
263 # Bison/Flex configuration
274 $(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS)
275 $(CC) $(OBJECTS) $(LDFLAGS) -o $(PROG)
278 # Parser and Lexer - intermediate C files
280 aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l
281 ${LEX} ${LFLAGS} -PAslCompiler -o$@ $?
283 aslcompilerparse.c aslcompilerparse.h : $(ASL_COMPILER)/aslcompiler.y
284 ${YACC} ${YFLAGS} -pAslCompiler -o$@ $?
286 dtparserlex.c : $(ASL_COMPILER)/dtparser.l
287 ${LEX} ${LFLAGS} -PDtParser -o$@ $?
289 dtparserparse.c dtparserparse.h : $(ASL_COMPILER)/dtparser.y
290 ${YACC} ${YFLAGS} -pDtParser -o$@ $?
292 # Rename headers produced by bison/yacc
294 dtparser.y.h: dtparserparse.h
295 @echo Copy intermediate file:
296 @cp -f -v dtparserparse.h dtparser.y.h
298 aslcompiler.y.h : aslcompilerparse.h
299 @echo Copy intermediate file:
300 @cp -f -v aslcompilerparse.h aslcompiler.y.h
304 # Parsers and Lexers - final object files
306 # Cannot use the common compile warning flags since the C files are created
307 # by the utilities above and they are not necessarily ANSI C, etc.
309 aslcompilerlex.o : aslcompilerlex.c
310 $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
312 aslcompilerparse.o : aslcompilerparse.c
313 $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
315 dtparserlex.o : dtparserlex.c
316 $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
318 dtparserparse.o : dtparserparse.c
319 $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
322 %.o : %.c $(HEADERS) $(ACPICA_HEADERS)
326 rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC)