1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
Patches by Robin H. Johnson <robbat2@gentoo.org> - 2006/05/29
Previously using GCC you had to do make clean between making each of the
seperate utilities. This was due to the fact that depending on what compiler
defines were passed, the output was different.
The following patch makes the output files reflect which utility they are
compiled for, so they don't conflict, and no make clean is needed.
This patch also adds a top level Makefile to allow quick building of the entire
package.
Also fixes parallel build issues in compiler/, where the yacc generated data
might used before it was ready.
diff -Nuar --exclude '*~' acpica-unix-20060512.orig/Makefile acpica-unix-20060512/Makefile
--- acpica-unix-20060512.orig/Makefile 1969-12-31 16:00:00.000000000 -0800
+++ acpica-unix-20060512/Makefile 2006-05-29 16:28:55.560238471 -0700
@@ -0,0 +1,31 @@
+PROGS= compiler/iasl tools/acpiexec/acpiexec tools/acpixtract/acpixtract tools/acpisrc/acpisrc
+ifndef CFLAGS
+CFLAGS= -O2 -g
+endif
+# warnings always important
+CFLAGS += -Wall -Wstrict-prototypes
+
+all: $(PROGS)
+
+iasl: compiler
+acpiexec: tools/acpiexec
+acpixtract: tools/acpixtract
+acpisrc: tools/acpisrc
+
+SUBDIRS = $(dir $(PROGS))
+.PHONY: $(SUBDIRS) all
+
+compiler: compiler/iasl
+tools/acpiexec: tools/acpiexec/acpiexec
+tools/acpixtract: tools/acpixtract/acpixtract
+tools/acpisrc: tools/acpisrc/acpisrc
+
+
+$(PROGS):
+ CFLAGS="$(CFLAGS)" $(MAKE) -C $(dir $(@))
+
+clean: clean-subdirs
+clean-subdirs:
+ for dir in $(SUBDIRS); do \
+ $(MAKE) -C $$dir clean; \
+ done
diff -Nuar --exclude '*~' acpica-unix-20060512.orig/compiler/Makefile acpica-unix-20060512/compiler/Makefile
--- acpica-unix-20060512.orig/compiler/Makefile 2006-05-12 14:13:31.000000000 -0700
+++ acpica-unix-20060512/compiler/Makefile 2006-05-29 16:34:25.050744637 -0700
@@ -87,7 +87,7 @@
../osunixxf.c
NOMAN= YES
-CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include
+CFLAGS+= -D_LINUX -DACPI_ASL_COMPILER -I../include
#YACC= yacc
YACC= bison
@@ -101,14 +101,22 @@
#CFLAGS+= -D_USE_BERKELEY_YACC
#.endif
-aslmain : $(patsubst %.c,%.o, $(SRCS))
- $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) \
- $(LOADLIBES) $(LDLIBS) -o iasl
+OBJNAME = iasl
+OBJS= $(patsubst %.c,%.$(OBJNAME).o, $(SRCS))
+%.$(OBJNAME).o: %.c
+ $(COMPILE.c) $(OUTPUT_OPTION) $<
+
+$(PROG) : $(OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) \
+ $(LOADLIBES) $(LDLIBS) -o $(PROG)
CLEANFILES= y.output y.tab.c y.tab.h aslcompiler.y.h \
- aslcompilerparse.c aslcompilerlex.c iasl
+ aslcompilerparse.c aslcompilerlex.c $(PROG)
-aslcompilerparse.c: aslcompiler.y
+# force the YACC work to be done before any sources
+# as they all depend on it.
+$(SRCS): aslcompiler.y.h
+aslcompiler.y.h: aslcompiler.y
${YACC} ${YFLAGS} aslcompiler.y
cp y.tab.c aslcompilerparse.c
cp y.tab.h aslcompiler.y.h
@@ -117,5 +125,5 @@
${LEX} ${LFLAGS} -PAslCompiler -oaslcompilerlex.c aslcompiler.l
clean :
- rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+ rm -f $(CLEANFILES) $(OBJS)
diff -Nuar --exclude '*~' acpica-unix-20060512.orig/tools/acpiexec/Makefile acpica-unix-20060512/tools/acpiexec/Makefile
--- acpica-unix-20060512.orig/tools/acpiexec/Makefile 2006-05-12 14:13:43.000000000 -0700
+++ acpica-unix-20060512/tools/acpiexec/Makefile 2006-05-29 16:33:43.551484557 -0700
@@ -131,14 +131,19 @@
../../osunixxf.c
-CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../include
+CFLAGS+= -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -I../../include
+OBJNAME = acpiexec
+OBJS= $(patsubst %.c,%.$(OBJNAME).o, $(SRCS))
-acpiexec : $(patsubst %.c,%.o, $(SRCS))
- $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
+%.$(OBJNAME).o: %.c
+ $(COMPILE.c) $(OUTPUT_OPTION) $<
+
+$(PROG): $(OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
CLEANFILES= $(PROG)
clean :
- rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+ rm -f $(CLEANFILES) $(OBJS)
diff -Nuar --exclude '*~' acpica-unix-20060512.orig/tools/acpisrc/Makefile acpica-unix-20060512/tools/acpisrc/Makefile
--- acpica-unix-20060512.orig/tools/acpisrc/Makefile 2006-05-12 14:13:44.000000000 -0700
+++ acpica-unix-20060512/tools/acpisrc/Makefile 2006-05-29 16:33:03.300322581 -0700
@@ -4,14 +4,19 @@
SRCS= ascase.c asconvrt.c asfile.c asmain.c asremove.c astable.c \
asutils.c osunixdir.c ../../common/getopt.c
-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include
+CFLAGS+= -D_LINUX -DACPI_APPLICATION -I../../include
+OBJNAME = acpi_application
+OBJS= $(patsubst %.c,%.$(OBJNAME).o, $(SRCS))
-aslmain : $(patsubst %.c,%.o, $(SRCS))
- $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
+%.$(OBJNAME).o: %.c
+ $(COMPILE.c) $(OUTPUT_OPTION) $<
+
+$(PROG) : $(OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
CLEANFILES= $(PROG)
clean :
- rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+ rm -f $(CLEANFILES) $(OBJS)
diff -Nuar --exclude '*~' acpica-unix-20060512.orig/tools/acpixtract/Makefile acpica-unix-20060512/tools/acpixtract/Makefile
--- acpica-unix-20060512.orig/tools/acpixtract/Makefile 2006-05-12 14:13:44.000000000 -0700
+++ acpica-unix-20060512/tools/acpixtract/Makefile 2006-05-29 16:32:50.047281484 -0700
@@ -3,14 +3,19 @@
PROG= acpixtract
SRCS= acpixtract.c
-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include
+CFLAGS+= -D_LINUX -DACPI_APPLICATION -I../../include
+OBJNAME = acpi_application
+OBJS= $(patsubst %.c,%.$(OBJNAME).o, $(SRCS))
-acpixtract : $(patsubst %.c,%.o, $(SRCS))
- $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
+%.$(OBJNAME).o: %.c
+ $(COMPILE.c) $(OUTPUT_OPTION) $<
+
+$(PROG) : $(OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
CLEANFILES= $(PROG)
clean :
- rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+ rm -f $(CLEANFILES) $(OBJS)
|