2012-06-30 01:21:57 +04:00
|
|
|
#
|
|
|
|
# Common make for acpica tools and utilities
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Get the OS machine architecture. Anything with a "64" in the returned
|
|
|
|
# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit.
|
|
|
|
#
|
|
|
|
HARDWARE_NAME := $(shell uname -m)
|
2012-07-13 21:22:24 +04:00
|
|
|
BITS=0
|
2012-06-30 01:21:57 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Main rule will only generate versions that are appropriate for the running
|
|
|
|
# OS, either 64-bit or 32-bit.
|
|
|
|
#
|
|
|
|
all: ${PROGS}
|
|
|
|
${PROGS}: FORCE
|
|
|
|
@cd $(BUILD_DIRECTORY_PATH)/$@; \
|
2012-07-13 21:22:24 +04:00
|
|
|
if [ $(BITS) -eq 32 ]; then \
|
|
|
|
echo "Forced 32-bit generation of $@"; \
|
2012-07-13 01:34:44 +04:00
|
|
|
mkdir -p obj32; \
|
|
|
|
make BITS=32; \
|
|
|
|
echo "32-bit version of $@:"; \
|
|
|
|
ls -al ../bin32/$@; \
|
|
|
|
elif [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
|
2012-06-30 01:21:57 +04:00
|
|
|
mkdir -p obj64; \
|
|
|
|
make BITS=64; \
|
|
|
|
echo "64-bit version of $@:"; \
|
2012-07-12 00:50:33 +04:00
|
|
|
ls -al ../bin64/$@; \
|
2012-06-30 01:21:57 +04:00
|
|
|
else \
|
|
|
|
mkdir -p obj32; \
|
|
|
|
make BITS=32; \
|
|
|
|
echo "32-bit version of $@:"; \
|
2012-07-12 00:50:33 +04:00
|
|
|
ls -al ../bin32/$@; \
|
2012-06-30 01:21:57 +04:00
|
|
|
fi;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make 32-bit and 64-bit versions of all the tools
|
|
|
|
#
|
|
|
|
both: 32 64
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make only 32-bit versions of all the tools
|
|
|
|
#
|
|
|
|
32: 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 \
|
|
|
|
); \
|
|
|
|
done;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make only 64-bit versions of all the tools
|
|
|
|
#
|
|
|
|
64: 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; \
|
2012-07-14 01:27:28 +04:00
|
|
|
echo "Removing $$toolname"; \
|
2012-06-30 01:21:57 +04:00
|
|
|
pwd; \
|
|
|
|
if [ -d "obj32" ] ; then \
|
|
|
|
make BITS=32 clean; \
|
|
|
|
rmdir obj32; \
|
|
|
|
fi; \
|
|
|
|
if [ -d "obj64" ] ; then \
|
|
|
|
make BITS=64 clean; \
|
|
|
|
rmdir obj64; \
|
|
|
|
fi; \
|
2012-07-14 01:27:28 +04:00
|
|
|
echo ""; \
|
2012-06-30 01:21:57 +04:00
|
|
|
); \
|
|
|
|
done;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install all tools, either 32-bit or 64-bit as appropriate for the host OS
|
|
|
|
#
|
|
|
|
install: FORCE
|
|
|
|
@for toolname in ${PROGS}; do \
|
|
|
|
(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
|
|
|
|
pwd; \
|
|
|
|
if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
|
2012-07-12 00:50:33 +04:00
|
|
|
make BITS=64 PROG=$$toolname install; \
|
2012-06-30 01:21:57 +04:00
|
|
|
echo "Installed 64-bit version of $$toolname"; \
|
|
|
|
else \
|
2012-07-12 00:50:33 +04:00
|
|
|
make BITS=32 PROG=$$toolname install; \
|
2012-06-30 01:21:57 +04:00
|
|
|
echo "Installed 32-bit version of $$toolname"; \
|
|
|
|
fi; \
|
2012-07-14 01:27:28 +04:00
|
|
|
echo ""; \
|
2012-06-30 01:21:57 +04:00
|
|
|
); \
|
|
|
|
done;
|
|
|
|
|
|
|
|
machine: FORCE
|
|
|
|
@echo "Machine architecture: $(HARDWARE_NAME), $(XBITS)";
|
|
|
|
@echo "Findstring: $(findstring 64, $(HARDWARE_NAME))";
|
|
|
|
|
|
|
|
FORCE:
|
|
|
|
|