aboutsummaryrefslogtreecommitdiff
path: root/generate/unix
diff options
context:
space:
mode:
Diffstat (limited to 'generate/unix')
-rw-r--r--generate/unix/Makefile.common85
-rw-r--r--generate/unix/Makefile.config54
-rw-r--r--generate/unix/Makefile.rules2
-rw-r--r--generate/unix/acpibin/Makefile2
-rw-r--r--generate/unix/acpidump/Makefile53
-rw-r--r--generate/unix/acpiexec/Makefile9
-rw-r--r--generate/unix/acpinames/Makefile2
-rw-r--r--generate/unix/iasl/Makefile4
8 files changed, 136 insertions, 75 deletions
diff --git a/generate/unix/Makefile.common b/generate/unix/Makefile.common
index 69e9806e9a5f..a0e26bab2cac 100644
--- a/generate/unix/Makefile.common
+++ b/generate/unix/Makefile.common
@@ -7,7 +7,6 @@
# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit.
#
HARDWARE_NAME := $(shell uname -m)
-BITS=0
#
# Main rule will only generate versions that are appropriate for the running
@@ -16,73 +15,54 @@ BITS=0
all: ${PROGS}
${PROGS}: FORCE
@cd $(BUILD_DIRECTORY_PATH)/$@; \
- if [ $(BITS) -eq 32 ]; then \
- echo "Forced 32-bit generation of $@"; \
- mkdir -p obj32; \
- make BITS=32; \
- echo "32-bit version of $@:"; \
- ls -al ../bin32/$@; \
- elif [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
- mkdir -p obj64; \
- make BITS=64; \
+ mkdir -p obj; \
+ make || exit "$$?"; \
+ if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
echo "64-bit version of $@:"; \
- ls -al ../bin64/$@; \
else \
- mkdir -p obj32; \
- make BITS=32; \
echo "32-bit version of $@:"; \
- ls -al ../bin32/$@; \
- fi;
-
-#
-# Make 32-bit and 64-bit versions of all the tools
-#
-both: 32 64
+ fi; \
+ ls -al ../bin/$@; \
+ echo "";
#
-# Make only 32-bit versions of all the tools
+# Simple clean removes all .obj files, but leaves the executables
+# in the local bin directory
#
-32: FORCE
+clean: FORCE
@for toolname in ${PROGS}; do \
(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
- pwd; \
- mkdir -p obj32; \
- make BITS=32; \
- echo "32-bit version of $$toolname:"; \
- ls -al obj32/$$toolname \
+ if [ -d "obj" ] ; then \
+ echo "Removing $$toolname:"; \
+ pwd; \
+ make clean; \
+ rmdir obj; \
+ echo ""; \
+ fi; \
); \
done;
#
-# Make only 64-bit versions of all the tools
+# Very clean removes all executables and the local bin directory
#
-64: FORCE
+veryclean: FORCE
@for toolname in ${PROGS}; do \
(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
- pwd; \
- mkdir -p obj64; \
- make BITS=64; \
- echo "64-bit version of $$toolname:"; \
- ls -al obj64/$$toolname \
- ); \
- done;
-
-clean: FORCE
- @for toolname in ${PROGS}; do \
- (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
- echo "Removing $$toolname"; \
- pwd; \
- if [ -d "obj32" ] ; then \
- make BITS=32 clean; \
- rmdir obj32; \
+ if [ -d "obj" ] ; then \
+ echo "Removing $$toolname:"; \
+ pwd; \
+ make clean; \
+ rmdir obj; \
+ echo ""; \
fi; \
- if [ -d "obj64" ] ; then \
- make BITS=64 clean; \
- rmdir obj64; \
- fi; \
- echo ""; \
); \
- done;
+ if [ -e "$(BUILD_DIRECTORY_PATH)/bin/$$toolname" ] ; then \
+ rm $(BUILD_DIRECTORY_PATH)/bin/$$toolname; \
+ fi; \
+ done; \
+ if [ -d "bin" ] ; then \
+ rmdir bin; \
+ fi;
#
# Install all tools, either 32-bit or 64-bit as appropriate for the host OS
@@ -91,11 +71,10 @@ install: FORCE
@for toolname in ${PROGS}; do \
(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
pwd; \
+ make PROG=$$toolname install; \
if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
- make BITS=64 PROG=$$toolname install; \
echo "Installed 64-bit version of $$toolname"; \
else \
- make BITS=32 PROG=$$toolname install; \
echo "Installed 32-bit version of $$toolname"; \
fi; \
echo ""; \
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config
index f5f046e5c326..390a4643d6a2 100644
--- a/generate/unix/Makefile.config
+++ b/generate/unix/Makefile.config
@@ -24,25 +24,36 @@
# adding OPT_CFLAGS="..." to the invocation.
#
# Notes:
-# $(BITS) must be set to either 32 or 64
# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
+# used will not be recognized.
+# Optional: Change HOST to an appropriate value (_LINUX, __FreeBSD__, etc.)
+# See include/platform/acenv.h for supported values.
+# Note: HOST is not nearly as important for applications as it
+# is for the kernel-resident version of ACPICA, and it may
+# not be necessary to change it.
#
.SUFFIXES :
-PROGS = acpibin acpiexec acpihelp acpinames acpisrc acpixtract iasl
-HOST = _CYGWIN
+PROGS = acpibin acpidump acpiexec acpihelp acpinames acpisrc acpixtract iasl
+HOST ?= _CYGWIN
CC = gcc
#
# Common defines
#
-OBJDIR = obj$(BITS)
-BINDIR = bin$(BITS)
-BITSFLAG = -m$(BITS)
+OBJDIR = obj
+BINDIR = bin
COMPILEOBJ = $(CC) -c $(CFLAGS) $(OPT_CFLAGS) -o $@ $<
LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS)
-INSTALLDIR = /usr/bin
-INSTALLPROG = install -D ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
+PREFIX ?= /usr
+INSTALLDIR = $(PREFIX)/bin
+
+ifneq ($(HOST), _APPLE)
+ INSTALLPROG = install -D ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
+else
+ INSTALLPROG = \
+ test -d $(DESTDIR)$(INSTALLDIR) || mkdir -p $(DESTDIR)$(INSTALLDIR); \
+ cp -f ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
+endif
#
# Rename a .exe file if necessary
@@ -54,11 +65,11 @@ RENAMEPROG = \
fi;
#
-# Copy the final file to the local bin[32|64] directory
+# Copy the final executable to the local bin directory
#
COPYPROG = \
@mkdir -p ../$(BINDIR); \
- cp --remove-destination $(PROG) ../$(BINDIR); \
+ cp -f $(PROG) ../$(BINDIR); \
echo "Copied $(PROG) to $(FINAL_PROG)";
#
@@ -86,6 +97,7 @@ ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
# ACPICA tool and utility source directories
#
ACPIBIN = $(ACPICA_TOOLS)/acpibin
+ACPIDUMP = $(ACPICA_TOOLS)/acpidump
ACPIEXEC = $(ACPICA_TOOLS)/acpiexec
ACPIHELP = $(ACPICA_TOOLS)/acpihelp
ACPINAMES = $(ACPICA_TOOLS)/acpinames
@@ -113,13 +125,10 @@ OPT_CFLAGS ?= \
$(CWARNINGFLAGS)
CFLAGS += \
- $(BITSFLAG)\
-D$(HOST)\
-D_GNU_SOURCE\
-I$(ACPICA_INCLUDE)
-LDFLAGS += $(BITSFLAG)
-
#
# Common compiler warning flags. The warning flags in addition
# to -Wall are not automatically included in -Wall.
@@ -140,22 +149,29 @@ CWARNINGFLAGS = \
-Wundef
#
-# Additional gcc 4+ warning flags
+# Common gcc 4+ warning flags
#
CWARNINGFLAGS += \
-Waddress\
-Waggregate-return\
-Wchar-subscripts\
-Wempty-body\
- -Wlogical-op\
-Wmissing-declarations\
-Wmissing-field-initializers\
- -Wmissing-parameter-type\
-Wnested-externs\
- -Wold-style-declaration\
-Wold-style-definition\
- -Wredundant-decls\
+ -Wredundant-decls
+
+#
+# Additional gcc 4+ flags
+#
+ifneq ($(HOST), _APPLE)
+CWARNINGFLAGS += \
+ -Wlogical-op\
+ -Wmissing-parameter-type\
+ -Wold-style-declaration\
-Wtype-limits
+endif
#
# Extra warning flags (for possible future use)
diff --git a/generate/unix/Makefile.rules b/generate/unix/Makefile.rules
index 2ec8b8beae2c..788b56aed7bd 100644
--- a/generate/unix/Makefile.rules
+++ b/generate/unix/Makefile.rules
@@ -1,7 +1,7 @@
#
# Common rules for generation of ACPICA utilities
#
-# FINAL_PROG - Copies the utility to the local binXX directory (32/64)
+# FINAL_PROG - Copies the utility to the local bin directory
# PROG - Builds the utility (links the object files)
#
# Note: $(INTERMEDIATES) and $(MISC) are used for iASL compiler only.
diff --git a/generate/unix/acpibin/Makefile b/generate/unix/acpibin/Makefile
index 1f6eb80e8b8c..2a5aff6e2851 100644
--- a/generate/unix/acpibin/Makefile
+++ b/generate/unix/acpibin/Makefile
@@ -30,8 +30,8 @@ OBJECTS = \
$(OBJDIR)/abcompare.o\
$(OBJDIR)/abmain.o\
$(OBJDIR)/utalloc.o\
+ $(OBJDIR)/utbuffer.o\
$(OBJDIR)/utcache.o\
- $(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
diff --git a/generate/unix/acpidump/Makefile b/generate/unix/acpidump/Makefile
new file mode 100644
index 000000000000..637ef33cee99
--- /dev/null
+++ b/generate/unix/acpidump/Makefile
@@ -0,0 +1,53 @@
+#
+# acpidump - ACPI table dump utility (binary to ascii hex)
+#
+
+#
+# Note: This makefile is intended to be used from within the native
+# ACPICA directory structure, from under generate/unix. It specifically
+# places all object files in a generate/unix subdirectory, not within
+# the various ACPICA source directories. This prevents collisions
+# between different compilations of the same source file with different
+# compile options, and prevents pollution of the source code.
+#
+include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/acpidump
+PROG = $(OBJDIR)/acpidump
+
+#
+# Search paths for source files
+#
+vpath %.c \
+ $(ACPIDUMP)\
+ $(ACPICA_TABLES)\
+ $(ACPICA_UTILITIES)\
+ $(ACPICA_COMMON)\
+ $(ACPICA_OSL)
+
+HEADERS = \
+ $(wildcard $(ACPIDUMP)/*.h)
+
+OBJECTS = \
+ $(OBJDIR)/apdump.o\
+ $(OBJDIR)/apfiles.o\
+ $(OBJDIR)/apmain.o\
+ $(OBJDIR)/tbprint.o\
+ $(OBJDIR)/utbuffer.o\
+ $(OBJDIR)/utexcep.o\
+ $(OBJDIR)/utmath.o\
+ $(OBJDIR)/utstring.o\
+ $(OBJDIR)/utxferror.o\
+ $(OBJDIR)/oslinuxtbl.o\
+ $(OBJDIR)/getopt.o
+
+#
+# Flags specific to acpidump
+#
+CFLAGS += \
+ -DACPI_DUMP_APP\
+ -I$(ACPIDUMP)
+
+#
+# Common Rules
+#
+include ../Makefile.rules
diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile
index 4fdb3537008d..706ec41608d4 100644
--- a/generate/unix/acpiexec/Makefile
+++ b/generate/unix/acpiexec/Makefile
@@ -180,17 +180,20 @@ OBJECTS = \
$(OBJDIR)/tbfadt.o\
$(OBJDIR)/tbfind.o\
$(OBJDIR)/tbinstal.o\
+ $(OBJDIR)/tbprint.o\
$(OBJDIR)/tbutils.o\
$(OBJDIR)/tbxface.o\
$(OBJDIR)/tbxfload.o\
$(OBJDIR)/tbxfroot.o\
$(OBJDIR)/utaddress.o\
$(OBJDIR)/utalloc.o\
+ $(OBJDIR)/utbuffer.o\
$(OBJDIR)/utcache.o\
$(OBJDIR)/utcopy.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utdelete.o\
+ $(OBJDIR)/uterror.o\
$(OBJDIR)/uteval.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
@@ -220,7 +223,11 @@ CFLAGS += \
-DACPI_EXEC_APP\
-I$(ACPIEXEC)
-LDFLAGS += -lpthread -lrt
+LDFLAGS += -lpthread
+
+ifneq ($(HOST),_APPLE)
+LDFLAGS += -lrt
+endif
#
# Common Rules
diff --git a/generate/unix/acpinames/Makefile b/generate/unix/acpinames/Makefile
index 98d95866246a..1438200c6b82 100644
--- a/generate/unix/acpinames/Makefile
+++ b/generate/unix/acpinames/Makefile
@@ -82,6 +82,7 @@ OBJECTS = \
$(OBJDIR)/tbfadt.o\
$(OBJDIR)/tbfind.o\
$(OBJDIR)/tbinstal.o\
+ $(OBJDIR)/tbprint.o\
$(OBJDIR)/tbutils.o\
$(OBJDIR)/tbxface.o\
$(OBJDIR)/tbxfload.o\
@@ -92,6 +93,7 @@ OBJECTS = \
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utdelete.o\
+ $(OBJDIR)/uterror.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
$(OBJDIR)/utlock.o\
diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile
index e7761c2769c3..931620a74170 100644
--- a/generate/unix/iasl/Makefile
+++ b/generate/unix/iasl/Makefile
@@ -69,6 +69,7 @@ OBJECTS = \
$(OBJDIR)/aslopcodes.o\
$(OBJDIR)/asloperands.o\
$(OBJDIR)/aslopt.o\
+ $(OBJDIR)/asloptions.o\
$(OBJDIR)/aslpredef.o\
$(OBJDIR)/aslprepkg.o\
$(OBJDIR)/aslresource.o\
@@ -172,15 +173,18 @@ OBJECTS = \
$(OBJDIR)/pswalk.o\
$(OBJDIR)/tbfadt.o\
$(OBJDIR)/tbinstal.o\
+ $(OBJDIR)/tbprint.o\
$(OBJDIR)/tbutils.o\
$(OBJDIR)/tbxface.o\
$(OBJDIR)/utaddress.o\
$(OBJDIR)/utalloc.o\
+ $(OBJDIR)/utbuffer.o\
$(OBJDIR)/utcache.o\
$(OBJDIR)/utcopy.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utdelete.o\
+ $(OBJDIR)/uterror.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
$(OBJDIR)/utinit.o\