Makefile.config revision 1.1.1.4 1 1.1 jruoho #
2 1.1 jruoho # Makefile.config
3 1.1 jruoho #
4 1.1 jruoho # Common configuration and setup file to generate the ACPICA tools and
5 1.1.1.2 jruoho # utilities: the iASL compiler, acpiexec, acpihelp, acpinames, acpisrc,
6 1.1.1.2 jruoho # acpixtract, acpibin.
7 1.1 jruoho #
8 1.1 jruoho # This file is included by the individual makefiles for each tool.
9 1.1 jruoho #
10 1.1 jruoho
11 1.1 jruoho #
12 1.1.1.2 jruoho # Note: This makefile is intended to be used from within the native
13 1.1.1.2 jruoho # ACPICA directory structure, from under generate/unix. It specifically
14 1.1.1.2 jruoho # places all object files in a generate/unix subdirectory, not within
15 1.1.1.2 jruoho # the various ACPICA source directories. This prevents collisions
16 1.1.1.2 jruoho # between different compilations of the same source file with different
17 1.1.1.2 jruoho # compile options, and prevents pollution of the source code.
18 1.1.1.2 jruoho #
19 1.1.1.2 jruoho
20 1.1.1.2 jruoho #
21 1.1 jruoho # Configuration
22 1.1.1.3 christos #
23 1.1.1.3 christos # OPT_CFLAGS can be overridden on the make command line by
24 1.1.1.3 christos # adding OPT_CFLAGS="..." to the invocation.
25 1.1.1.3 christos #
26 1.1.1.2 jruoho # Notes:
27 1.1.1.2 jruoho # gcc should be version 4 or greater, otherwise some of the options
28 1.1.1.3 christos # used will not be recognized.
29 1.1.1.3 christos # Optional: Set HOST to an appropriate value (_LINUX, _FreeBSD, _APPLE, _CYGWIN, etc.)
30 1.1.1.3 christos # See include/platform/acenv.h for supported values.
31 1.1.1.3 christos # Note: HOST is not nearly as important for applications as it
32 1.1.1.3 christos # is for the kernel-resident version of ACPICA, and it may
33 1.1.1.3 christos # not be necessary to change it.
34 1.1.1.3 christos #
35 1.1.1.3 christos .SUFFIXES :
36 1.1.1.3 christos PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpinames acpisrc acpixtract iasl
37 1.1.1.3 christos HOST ?= _CYGWIN
38 1.1.1.3 christos CC = gcc
39 1.1 jruoho
40 1.1 jruoho #
41 1.1 jruoho # Common defines
42 1.1 jruoho #
43 1.1.1.3 christos OBJDIR = obj
44 1.1.1.3 christos BINDIR = bin
45 1.1.1.3 christos COMPILEOBJ = $(CC) -c $(CFLAGS) $(OPT_CFLAGS) -o $@ $<
46 1.1.1.3 christos LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS)
47 1.1.1.3 christos PREFIX ?= /usr
48 1.1.1.3 christos INSTALLDIR = $(PREFIX)/bin
49 1.1.1.4 christos UNAME_S := $(shell uname -s)
50 1.1.1.4 christos
51 1.1.1.4 christos #
52 1.1.1.4 christos # Host detection and configuration
53 1.1.1.4 christos #
54 1.1.1.4 christos ifeq ($(UNAME_S), Darwin) # Mac OS X
55 1.1.1.4 christos HOST = _APPLE
56 1.1.1.4 christos endif
57 1.1.1.4 christos
58 1.1.1.4 christos ifeq ($(UNAME_S), FreeBSD)
59 1.1.1.4 christos HOST = _FreeBSD
60 1.1.1.4 christos endif
61 1.1.1.3 christos
62 1.1.1.3 christos ifeq ($(HOST), _APPLE)
63 1.1.1.3 christos INSTALL = cp
64 1.1.1.3 christos INSTALLFLAGS ?= -f
65 1.1.1.3 christos else
66 1.1.1.3 christos INSTALL = install
67 1.1.1.3 christos INSTALLFLAGS ?= -m 555 -s
68 1.1.1.3 christos endif
69 1.1.1.3 christos
70 1.1.1.3 christos INSTALLPROG = \
71 1.1.1.3 christos mkdir -p $(DESTDIR)$(INSTALLDIR); \
72 1.1.1.3 christos $(INSTALL) $(INSTALLFLAGS) ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
73 1.1.1.3 christos
74 1.1.1.3 christos #
75 1.1.1.3 christos # Rename a .exe file if necessary
76 1.1.1.3 christos #
77 1.1.1.3 christos RENAMEPROG = \
78 1.1.1.3 christos @if [ -e "$(PROG).exe" ] ; then \
79 1.1.1.3 christos mv $(PROG).exe $(PROG); \
80 1.1.1.3 christos echo "Renamed $(PROG).exe to $(PROG)"; \
81 1.1.1.3 christos fi;
82 1.1.1.3 christos
83 1.1.1.3 christos #
84 1.1.1.3 christos # Copy the final executable to the local bin directory
85 1.1.1.3 christos #
86 1.1.1.3 christos COPYPROG = \
87 1.1.1.3 christos @mkdir -p ../$(BINDIR); \
88 1.1.1.3 christos cp -f $(PROG) ../$(BINDIR); \
89 1.1.1.3 christos echo "Copied $(PROG) to $(FINAL_PROG)";
90 1.1.1.3 christos
91 1.1.1.3 christos #
92 1.1.1.3 christos # Main ACPICA source directories
93 1.1.1.3 christos #
94 1.1.1.3 christos ACPICA_SRC = ../../../source
95 1.1.1.3 christos ACPICA_COMMON = $(ACPICA_SRC)/common
96 1.1.1.3 christos ACPICA_TOOLS = $(ACPICA_SRC)/tools
97 1.1.1.3 christos ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
98 1.1.1.3 christos ACPICA_CORE = $(ACPICA_SRC)/components
99 1.1.1.3 christos ACPICA_INCLUDE = $(ACPICA_SRC)/include
100 1.1.1.3 christos ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
101 1.1.1.3 christos ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
102 1.1.1.3 christos ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
103 1.1.1.3 christos ACPICA_EVENTS = $(ACPICA_CORE)/events
104 1.1.1.3 christos ACPICA_EXECUTER = $(ACPICA_CORE)/executer
105 1.1.1.3 christos ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
106 1.1.1.3 christos ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
107 1.1.1.3 christos ACPICA_PARSER = $(ACPICA_CORE)/parser
108 1.1.1.3 christos ACPICA_RESOURCES = $(ACPICA_CORE)/resources
109 1.1.1.3 christos ACPICA_TABLES = $(ACPICA_CORE)/tables
110 1.1.1.3 christos ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
111 1.1.1.3 christos
112 1.1.1.3 christos #
113 1.1.1.3 christos # ACPICA tool and utility source directories
114 1.1.1.3 christos #
115 1.1.1.3 christos ACPIBIN = $(ACPICA_TOOLS)/acpibin
116 1.1.1.3 christos ACPIDUMP = $(ACPICA_TOOLS)/acpidump
117 1.1.1.3 christos ACPIEXAMPLES = $(ACPICA_TOOLS)/examples
118 1.1.1.3 christos ACPIEXEC = $(ACPICA_TOOLS)/acpiexec
119 1.1.1.3 christos ACPIHELP = $(ACPICA_TOOLS)/acpihelp
120 1.1.1.3 christos ACPINAMES = $(ACPICA_TOOLS)/acpinames
121 1.1.1.3 christos ACPISRC = $(ACPICA_TOOLS)/acpisrc
122 1.1.1.3 christos ACPIXTRACT = $(ACPICA_TOOLS)/acpixtract
123 1.1.1.3 christos ASL_COMPILER = $(ACPICA_SRC)/compiler
124 1.1.1.3 christos
125 1.1.1.3 christos #
126 1.1.1.3 christos # Common ACPICA header files
127 1.1.1.3 christos #
128 1.1.1.3 christos ACPICA_HEADERS = \
129 1.1.1.3 christos $(wildcard $(ACPICA_INCLUDE)/*.h) \
130 1.1.1.3 christos $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
131 1.1.1.3 christos
132 1.1 jruoho #
133 1.1.1.3 christos # Common compiler flags
134 1.1.1.3 christos # The _GNU_SOURCE symbol is required for many hosts.
135 1.1 jruoho #
136 1.1.1.3 christos OPT_CFLAGS ?= $(CWARNINGFLAGS)
137 1.1.1.3 christos
138 1.1.1.3 christos #
139 1.1.1.3 christos # Optionally disable optimizations. Optimization causes problems on
140 1.1.1.3 christos # some compilers such as gcc 4.4
141 1.1.1.3 christos #
142 1.1.1.3 christos ifneq ($(NOOPT),TRUE)
143 1.1.1.3 christos OPT_CFLAGS += -O2 -D_FORTIFY_SOURCE=2
144 1.1.1.3 christos endif
145 1.1.1.3 christos
146 1.1.1.2 jruoho CFLAGS += \
147 1.1.1.3 christos -D$(HOST)\
148 1.1.1.3 christos -D_GNU_SOURCE\
149 1.1.1.3 christos -I$(ACPICA_INCLUDE)
150 1.1.1.2 jruoho
151 1.1.1.3 christos #
152 1.1.1.3 christos # Common compiler warning flags. The warning flags in addition
153 1.1.1.3 christos # to -Wall are not automatically included in -Wall.
154 1.1.1.3 christos #
155 1.1 jruoho CWARNINGFLAGS = \
156 1.1.1.3 christos -ansi\
157 1.1.1.3 christos -Wall\
158 1.1.1.3 christos -Wbad-function-cast\
159 1.1.1.3 christos -Wdeclaration-after-statement\
160 1.1.1.3 christos -Werror\
161 1.1.1.3 christos -Wformat=2\
162 1.1.1.3 christos -Wmissing-declarations\
163 1.1.1.3 christos -Wmissing-prototypes\
164 1.1.1.3 christos -Wstrict-aliasing=0\
165 1.1.1.3 christos -Wstrict-prototypes\
166 1.1.1.3 christos -Wswitch-default\
167 1.1.1.3 christos -Wpointer-arith\
168 1.1.1.2 jruoho -Wundef
169 1.1 jruoho
170 1.1 jruoho #
171 1.1.1.3 christos # Common gcc 4+ warning flags
172 1.1 jruoho #
173 1.1.1.2 jruoho CWARNINGFLAGS += \
174 1.1.1.3 christos -Waddress\
175 1.1.1.3 christos -Waggregate-return\
176 1.1.1.4 christos -Winit-self\
177 1.1.1.4 christos -Winline\
178 1.1.1.3 christos -Wmissing-declarations\
179 1.1.1.3 christos -Wmissing-field-initializers\
180 1.1.1.3 christos -Wnested-externs\
181 1.1.1.3 christos -Wold-style-definition\
182 1.1.1.4 christos -Woverride-init\
183 1.1.1.3 christos -Wno-format-nonliteral\
184 1.1.1.3 christos -Wredundant-decls
185 1.1.1.3 christos #
186 1.1.1.3 christos # Per-host flags and exclusions
187 1.1.1.3 christos #
188 1.1.1.3 christos ifneq ($(HOST), _FreeBSD)
189 1.1.1.3 christos CWARNINGFLAGS += \
190 1.1.1.3 christos -Wempty-body
191 1.1.1.3 christos
192 1.1.1.3 christos ifneq ($(HOST), _APPLE)
193 1.1.1.3 christos CWARNINGFLAGS += \
194 1.1.1.3 christos -Wlogical-op\
195 1.1.1.3 christos -Wmissing-parameter-type\
196 1.1.1.3 christos -Wold-style-declaration\
197 1.1.1.3 christos -Wtype-limits
198 1.1.1.3 christos endif
199 1.1.1.3 christos endif
200 1.1 jruoho
201 1.1 jruoho #
202 1.1.1.3 christos # Extra warning flags (for possible future use)
203 1.1 jruoho #
204 1.1.1.2 jruoho #CWARNINGFLAGS += \
205 1.1.1.3 christos # -Wcast-qual\
206 1.1.1.3 christos # -Wconversion\
207 1.1.1.3 christos # -Wshadow\
208 1.1 jruoho
209 1.1 jruoho #
210 1.1.1.4 christos # M4 macro processor is used to build the final parser file
211 1.1.1.4 christos #
212 1.1 jruoho # Bison/Flex configuration
213 1.1 jruoho #
214 1.1.1.2 jruoho # -y: act like yacc
215 1.1.1.2 jruoho #
216 1.1.1.2 jruoho # -i: generate case insensitive scanner
217 1.1.1.2 jruoho # -s: suppress default rule, abort on unknown input
218 1.1.1.2 jruoho #
219 1.1.1.3 christos # Optional for Bison/yacc:
220 1.1.1.3 christos # -v: verbose, produces a .output file
221 1.1.1.3 christos # -d: produces the defines header file
222 1.1.1.3 christos #
223 1.1.1.2 jruoho # Berkeley yacc configuration
224 1.1.1.2 jruoho #
225 1.1.1.2 jruoho #YACC= byacc
226 1.1.1.3 christos #YFLAGS +=
227 1.1.1.2 jruoho #
228 1.1.1.2 jruoho YACC= bison
229 1.1.1.3 christos YFLAGS += -y
230 1.1 jruoho
231 1.1.1.4 christos MACROPROC= m4
232 1.1.1.4 christos MFLAGS= -P -I$(ASL_COMPILER)
233 1.1.1.4 christos
234 1.1.1.2 jruoho LEX= flex
235 1.1.1.2 jruoho LFLAGS += -i -s
236 1.1.1.3 christos
237