summaryrefslogtreecommitdiff
blob: 27056b35568900e6b73db69696082aed2fef5a1f (plain)
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
Patches by Robin H. Johnson <robbat2@gentoo.org> - 2005/12/27

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/ and two compile issues with
acpibin.
diff -Naur acpica-unix-20051216/Makefile acpica-unix-20051216.new/Makefile
--- acpica-unix-20051216/Makefile	1969-12-31 16:00:00.000000000 -0800
+++ acpica-unix-20051216.new/Makefile	2005-12-27 10:15:13.000000000 -0800
@@ -0,0 +1,29 @@
+PROGS= compiler/iasl  tools/acpiexec/acpiexec tools/acpibin/acpibin tools/acpisrc/acpisrc
+ifndef CFLAGS
+CFLAGS= -O2
+endif
+
+all: $(PROGS)
+
+iasl: compiler
+acpiexec: tools/acpiexec
+acpibin: tools/acpibin
+acpisrc: tools/acpisrc
+
+SUBDIRS = $(dir $(PROGS))
+.PHONY: $(SUBDIRS) all
+
+compiler: compiler/iasl
+tools/acpiexec: tools/acpiexec/acpiexec
+tools/acpibin: tools/acpibin/acpibin
+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 -Naur acpica-unix-20051216/compiler/Makefile acpica-unix-20051216.new/compiler/Makefile
--- acpica-unix-20051216/compiler/Makefile	2005-12-16 14:11:58.000000000 -0800
+++ acpica-unix-20051216.new/compiler/Makefile	2005-12-27 10:07:34.000000000 -0800
@@ -81,7 +81,7 @@
 	../osunixxf.c
 
 NOMAN=	YES
-CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include 
+CFLAGS+= -Wall -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include 
 
 #YACC=	yacc
 YACC=	bison
@@ -95,14 +95,22 @@
 #CFLAGS+= -D_USE_BERKELEY_YACC
 #.endif
 
-aslmain : $(patsubst %.c,%.o, $(SRCS))
-	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) \
+%.iasl.o: %.c
+	$(COMPILE.c) $(OUTPUT_OPTION) $<
+
+OBJS= $(patsubst %.c,%.iasl.o, $(SRCS))
+
+aslmain : $(OBJS)
+	$(CC) $(LDFLAGS) $(OBJS) \
 		$(LOADLIBES) $(LDLIBS) -o iasl
 
 CLEANFILES= y.output y.tab.c y.tab.h aslcompiler.y.h \
 	aslcompilerparse.c aslcompilerlex.c iasl
 
-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
@@ -111,5 +119,5 @@
 	${LEX} ${LFLAGS} -PAslCompiler -oaslcompilerlex.c aslcompiler.l
 
 clean : 
-	rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+	rm -f $(CLEANFILES) $(OBJS)
 
diff -Naur acpica-unix-20051216/tools/acpibin/Makefile acpica-unix-20051216.new/tools/acpibin/Makefile
--- acpica-unix-20051216/tools/acpibin/Makefile	2005-12-16 14:12:10.000000000 -0800
+++ acpica-unix-20051216.new/tools/acpibin/Makefile	2005-12-27 09:43:28.000000000 -0800
@@ -12,14 +12,18 @@
 	../../osunixxf.c \
     ../../common/getopt.c
 
-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include 
+CFLAGS+= -Wall -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include 
 
+%.acpibinsrc.o: %.c
+	$(COMPILE.c) $(OUTPUT_OPTION) $<
 
-acpibin : $(patsubst %.c,%.o, $(SRCS))
-	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
+OBJS= $(patsubst %.c,%.acpibinsrc.o, $(SRCS))
+
+acpibin : $(OBJS)
+	$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
 CLEANFILES= $(PROG)
 
 clean : 
-	rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+	rm -f $(CLEANFILES) $(OBJS)
 
diff -Naur acpica-unix-20051216/tools/acpibin/abcompare.c acpica-unix-20051216.new/tools/acpibin/abcompare.c
--- acpica-unix-20051216/tools/acpibin/abcompare.c	2005-12-16 14:12:10.000000000 -0800
+++ acpica-unix-20051216.new/tools/acpibin/abcompare.c	2005-12-26 23:44:16.000000000 -0800
@@ -116,6 +116,7 @@
  *****************************************************************************/
 
 #include "acpibin.h"
+#define O_BINARY 0
 #include <stdlib.h>
 
 
diff -Naur acpica-unix-20051216/tools/acpibin/acpibin.h acpica-unix-20051216.new/tools/acpibin/acpibin.h
--- acpica-unix-20051216/tools/acpibin/acpibin.h	2005-12-16 14:12:10.000000000 -0800
+++ acpica-unix-20051216.new/tools/acpibin/acpibin.h	2005-12-26 23:44:02.000000000 -0800
@@ -120,9 +120,9 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#include <io.h>
+#include <sys/io.h>
 #include <ctype.h>
-#include <direct.h>
+//#include <direct.h>
 #include <errno.h>
 
 #include "acpi.h"
diff -Naur acpica-unix-20051216/tools/acpiexec/Makefile acpica-unix-20051216.new/tools/acpiexec/Makefile
--- acpica-unix-20051216/tools/acpiexec/Makefile	2005-12-16 14:12:10.000000000 -0800
+++ acpica-unix-20051216.new/tools/acpiexec/Makefile	2005-12-27 09:41:46.000000000 -0800
@@ -130,14 +130,18 @@
 	../../osunixxf.c
 
 
-CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../include 
+CFLAGS+= -Wall -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../include 
 
+%.acpiexec.o: %.c
+	$(COMPILE.c) $(OUTPUT_OPTION) $<
 
-acpiexec : $(patsubst %.c,%.o, $(SRCS))
-	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
+OBJS = $(patsubst %.c,%.acpiexec.o, $(SRCS))
+
+acpiexec : $(OBJS)
+	$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
 CLEANFILES= $(PROG)
 
 clean : 
-	rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+	rm -f $(CLEANFILES) $(OBJS)
 
diff -Naur acpica-unix-20051216/tools/acpisrc/Makefile acpica-unix-20051216.new/tools/acpisrc/Makefile
--- acpica-unix-20051216/tools/acpisrc/Makefile	2005-12-16 14:12:11.000000000 -0800
+++ acpica-unix-20051216.new/tools/acpisrc/Makefile	2005-12-27 09:43:21.000000000 -0800
@@ -4,14 +4,18 @@
 SRCS=	ascase.c asconvrt.c asfile.c asmain.c asremove.c asutils.c osunixdir.c \
         ../../common/getopt.c
 
-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include 
+CFLAGS+= -Wall -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include 
 
+%.acpibinsrc.o: %.c
+	$(COMPILE.c) $(OUTPUT_OPTION) $<
 
-aslmain : $(patsubst %.c,%.o, $(SRCS))
-	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
+OBJS= $(patsubst %.c,%.acpibinsrc.o, $(SRCS))
+
+aslmain : $(OBJS)
+	$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
 CLEANFILES= $(PROG)
 
 clean : 
-	rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
+	rm -f $(CLEANFILES) $(OBJS)