File: Makefile.common

package info (click to toggle)
acpica-unix 20140926-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 31,916 kB
  • ctags: 13,890
  • sloc: ansic: 136,284; sh: 4,244; yacc: 3,217; makefile: 1,493; lex: 939
file content (93 lines) | stat: -rw-r--r-- 2,057 bytes parent folder | download
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
#
# 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.
#
ifeq ($(HOST), _FreeBSD)
HARDWARE_NAME := $(shell uname -p)
else
HARDWARE_NAME := $(shell uname -m)
endif

#
# 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)/$@; \
	mkdir -p obj; \
	$(MAKE) || exit "$$?"; \
	if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
		echo "64-bit version of $@:"; \
	else \
		echo "32-bit version of $@:"; \
	fi; \
	ls -al ../bin/$@; \
	echo "";

#
# Simple clean removes all .obj files, but leaves the executables
# in the local bin directory
#
clean:	FORCE
	@for toolname in $(PROGS); do \
		(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
		if [ -d "obj" ] ; then \
			echo "Removing $$toolname:"; \
			pwd; \
			$(MAKE) clean; \
			rmdir obj; \
			echo ""; \
		fi; \
		); \
	done;

#
# Very clean removes all executables and the local bin directory
#
veryclean:	FORCE
	@for toolname in $(PROGS); do \
		(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
		if [ -d "obj" ] ; then \
			echo "Removing $$toolname:"; \
			pwd; \
			$(MAKE) clean; \
			rmdir obj; \
			echo ""; \
		fi; \
		); \
		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
#
install:	FORCE
	@for toolname in $(PROGS); do \
		(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
		pwd; \
		$(MAKE) PROG=$$toolname install; \
		if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
			echo "Installed 64-bit version of $$toolname"; \
		else \
			echo "Installed 32-bit version of $$toolname"; \
		fi; \
		echo ""; \
		); \
	done;

machine:	FORCE
	@echo "Machine architecture: $(HARDWARE_NAME), $(XBITS)";
	@echo "Findstring: $(findstring 64, $(HARDWARE_NAME))";

FORCE: