]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - source/tools/acpihelp/Makefile
Import ACPICA 20120215.
[FreeBSD/FreeBSD.git] / source / tools / acpihelp / Makefile
1 #
2 # acpihelp - ACPI Help utility. Displays ASL operator syntax and
3 # information about ACPI predefined names.
4 #
5 # NOTE: This makefile is intended to be used within the native
6 # ACPICA source tree.
7 #
8
9 #
10 # Configuration
11 # Notes:
12 #   gcc should be version 4 or greater, otherwise some of the options
13 #       used will not be recognized.
14 #   Global optimization flags (such as -O2, -Os) are not used, since
15 #       they cause issues on some compilers.
16 #   The _GNU_SOURCE symbol is required for many hosts.
17 #
18 PROG = acpihelp
19
20 HOST =          _LINUX
21 NOMAN =         YES
22 COMPILE =       $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
23
24 ACPICA_SRC =            ../../../source
25 ACPICA_COMMON =         $(ACPICA_SRC)/common
26 ACPICA_TOOLS =          $(ACPICA_SRC)/tools
27 ACPICA_OSL =            $(ACPICA_SRC)/os_specific/service_layers
28 ACPICA_CORE =           $(ACPICA_SRC)/components
29 ACPICA_INCLUDE =        $(ACPICA_SRC)/include
30 ACPICA_DEBUGGER =       $(ACPICA_CORE)/debugger
31 ACPICA_DISASSEMBLER =   $(ACPICA_CORE)/disassembler
32 ACPICA_DISPATCHER =     $(ACPICA_CORE)/dispatcher
33 ACPICA_EVENTS =         $(ACPICA_CORE)/events
34 ACPICA_EXECUTER =       $(ACPICA_CORE)/executer
35 ACPICA_HARDWARE =       $(ACPICA_CORE)/hardware
36 ACPICA_NAMESPACE =      $(ACPICA_CORE)/namespace
37 ACPICA_PARSER =         $(ACPICA_CORE)/parser
38 ACPICA_RESOURCES =      $(ACPICA_CORE)/resources
39 ACPICA_TABLES =         $(ACPICA_CORE)/tables
40 ACPICA_UTILITIES =      $(ACPICA_CORE)/utilities
41 ACPIHELP =              $(ACPICA_TOOLS)/acpihelp
42 INSTALLDIR =            /usr/bin
43 INSTALLPROG =           cp --remove-destination $(PROG) $(INSTALLDIR)
44
45 ACPICA_HEADERS = \
46     $(wildcard $(ACPICA_INCLUDE)/*.h) \
47     $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
48
49 #
50 # Search paths for source files
51 #
52 vpath %.c \
53     $(ACPIHELP) \
54     $(ACPICA_COMMON)
55
56 HEADERS = \
57     $(wildcard $(ACPIHELP)/*.h)
58
59 OBJECTS = \
60         ahamlops.o \
61         ahaslkey.o \
62         ahaslops.o \
63         ahdecode.o \
64         ahpredef.o \
65         ahmain.o \
66         getopt.o
67
68 CFLAGS+= \
69     -D$(HOST) \
70     -D_GNU_SOURCE \
71     -DACPI_HELP_APP \
72     -I$(ACPICA_INCLUDE)
73
74 CWARNINGFLAGS = \
75     -ansi \
76     -Wall \
77     -Wbad-function-cast \
78     -Wdeclaration-after-statement \
79     -Werror \
80     -Wformat=2 \
81     -Wmissing-declarations \
82     -Wmissing-prototypes \
83     -Wstrict-aliasing=0 \
84     -Wstrict-prototypes \
85     -Wswitch-default \
86     -Wpointer-arith \
87     -Wundef
88
89 #
90 # gcc 4+ flags
91 #
92 CWARNINGFLAGS += \
93     -Waddress \
94     -Waggregate-return \
95     -Wchar-subscripts \
96     -Wempty-body \
97     -Wlogical-op \
98     -Wmissing-declarations \
99     -Wmissing-field-initializers \
100     -Wmissing-parameter-type \
101     -Wnested-externs \
102     -Wold-style-declaration \
103     -Wold-style-definition \
104     -Wredundant-decls \
105     -Wtype-limits
106
107 #
108 # Rules
109 #
110 $(PROG) : $(OBJECTS)
111         $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
112         $(COPYPROG)
113
114 %.o : %.c $(HEADERS) $(ACPICA_HEADERS)
115         $(COMPILE)
116
117 clean :
118         rm -f $(PROG) $(PROG).exe $(OBJECTS)
119
120 install :
121         $(INSTALLPROG)