common/makefiles/devkit/Makefile

changeset 839
174a54ce39c4
parent 740
c0fa87863427
equal deleted inserted replaced
838:ec48d637778a 839:174a54ce39c4
23 # questions. 23 # questions.
24 # 24 #
25 25
26 ########################################################################################## 26 ##########################################################################################
27 # 27 #
28 # This Makefile, together with Tools.gmk, can be used to compile a set of 28 # This Makefile, together with Tools.gmk, can be used to compile a set of
29 # gcc based cross compilation, portable, self contained packages, capable 29 # gcc based cross compilation, portable, self contained packages, capable
30 # of building OpenJDK. 30 # of building OpenJDK.
31 # 31 #
32 # In addition to the makefiles, access to Oracle Linux installation 32 # In addition to the makefiles, access to Oracle Linux installation
33 # media is required. This has been tested against Oracle Enterprise Linux 33 # media is required. This has been tested against Oracle Enterprise Linux
34 # 5.5. Set variables RPM_DIR_x86_64 and RPM_DIR_i686 respectively to point 34 # 5.5. Set variables RPM_DIR_x86_64 and RPM_DIR_i686 respectively to point
35 # to directory containing the RPMs. 35 # to directory containing the RPMs.
36 # 36 #
37 # By default this Makefile will build crosstools for: 37 # By default this Makefile will build crosstools for:
38 # * i686-unknown-linux-gnu 38 # * i686-unknown-linux-gnu
41 # be able to compile 32bit binaries with the -m32 flag. This makes the 41 # be able to compile 32bit binaries with the -m32 flag. This makes the
42 # explicit cross compiler for i686 somewhat redundant and is a known issue. 42 # explicit cross compiler for i686 somewhat redundant and is a known issue.
43 # 43 #
44 # To build the full set of crosstools, use a command line looking like this: 44 # To build the full set of crosstools, use a command line looking like this:
45 # 45 #
46 # make tars RPM_DIR_x86_64=/tmp/oel55-x86_64/Server/ RPM_DIR_i686=/tmp/oel55-i686/Server/ 46 # make tars RPM_DIR_x86_64=/tmp/oel55-x86_64/Server/ RPM_DIR_i686=/tmp/oel55-i686/Server/
47 # 47 #
48 # To create a x86_64 package without the redundant i686 cross compiler, do 48 # To create a x86_64 package without the redundant i686 cross compiler, do
49 # like this: 49 # like this:
50 # 50 #
51 # make tars platforms=x86_64-unknown-linux-gnu RPM_DIR_x86_64=/tmp/oel55-x86_64/Server/ RPM_DIR_i686=/tmp/oel55-i686/Server/ 51 # make tars platforms=x86_64-unknown-linux-gnu RPM_DIR_x86_64=/tmp/oel55-x86_64/Server/ RPM_DIR_i686=/tmp/oel55-i686/Server/
52 52
53 # 53 #
54 # Main makefile which iterates over all host and target platforms. 54 # Main makefile which iterates over all host and target platforms.
55 # 55 #
56 56
57 os := $(shell uname -o) 57 os := $(shell uname -o)
58 cpu := x86_64 58 cpu := x86_64
59 #$(shell uname -p) 59 #$(shell uname -p)
60 60
61 # 61 #
62 # This wrapper script can handle exactly these platforms 62 # This wrapper script can handle exactly these platforms
63 # 63 #
64 platforms := $(foreach p,x86_64 i686,$(p)-unknown-linux-gnu) 64 platforms := $(foreach p,x86_64 i686,$(p)-unknown-linux-gnu)
65 #platforms := $(foreach p,x86_64,$(p)-unknown-linux-gnu) 65 #platforms := $(foreach p,x86_64,$(p)-unknown-linux-gnu)
66 66
67 # Figure out what platform this is building on. 67 # Figure out what platform this is building on.
68 me := $(cpu)-$(if $(findstring Linux,$(os)),unknown-linux-gnu) 68 me := $(cpu)-$(if $(findstring Linux,$(os)),unknown-linux-gnu)
69 69
70 $(info Building on platform $(me)) 70 $(info Building on platform $(me))
71 71
72 all compile : $(platforms) 72 all compile : $(platforms)
73 73
74 ifeq (,$(SKIP_ME)) 74 ifeq (,$(SKIP_ME))
75 $(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me))) 75 $(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me)))
76 endif 76 endif
77 77
78 OUTPUT_ROOT = $(abspath ../../../build/devkit) 78 OUTPUT_ROOT = $(abspath ../../../build/devkit)
79 RESULT = $(OUTPUT_ROOT)/result 79 RESULT = $(OUTPUT_ROOT)/result
80 80
81 submakevars = HOST=$@ BUILD=$(me) \ 81 submakevars = HOST=$@ BUILD=$(me) \
82 RESULT=$(RESULT) PREFIX=$(RESULT)/$@ \ 82 RESULT=$(RESULT) PREFIX=$(RESULT)/$@ \
83 OUTPUT_ROOT=$(OUTPUT_ROOT) 83 OUTPUT_ROOT=$(OUTPUT_ROOT)
84 $(platforms) : 84 $(platforms) :
85 @echo 'Building compilers for $@' 85 @echo 'Building compilers for $@'
86 @echo 'Targets: $(platforms)' 86 @echo 'Targets: $(platforms)'
87 for p in $@ $(filter-out $@,$(platforms)); do \ 87 for p in $@ $(filter-out $@,$(platforms)); do \
88 $(MAKE) -f Tools.gmk all $(submakevars) \ 88 $(MAKE) -f Tools.gmk all $(submakevars) \
89 TARGET=$$p || exit 1 ; \ 89 TARGET=$$p || exit 1 ; \
90 done 90 done
91 @echo 'Building ccache program for $@' 91 @echo 'Building ccache program for $@'
92 $(MAKE) -f Tools.gmk ccache $(submakevars) TARGET=$@ 92 $(MAKE) -f Tools.gmk ccache $(submakevars) TARGET=$@
93 @echo 'All done"' 93 @echo 'All done"'
94 94
95 $(foreach a,i686 x86_64,$(eval $(a) : $(filter $(a)%,$(platforms)))) 95 $(foreach a,i686 x86_64,$(eval $(a) : $(filter $(a)%,$(platforms))))
96 96
97 ia32 : i686 97 ia32 : i686
98 today := $(shell date +%Y%m%d) 98 today := $(shell date +%Y%m%d)
99 99
100 100
101 define Mktar 101 define Mktar
102 $(1)_tar = $$(RESULT)/sdk-$(1)-$$(today).tar.gz 102 $(1)_tar = $$(RESULT)/sdk-$(1)-$$(today).tar.gz
103 $$($(1)_tar) : PLATFORM = $(1) 103 $$($(1)_tar) : PLATFORM = $(1)
104 TARFILES += $$($(1)_tar) 104 TARFILES += $$($(1)_tar)
105 $$($(1)_tar) : $(1) $$(shell find $$(RESULT)/$(1)) 105 $$($(1)_tar) : $(1) $$(shell find $$(RESULT)/$(1))
106 endef 106 endef
107 107
108 $(foreach p,$(platforms),$(eval $(call Mktar,$(p)))) 108 $(foreach p,$(platforms),$(eval $(call Mktar,$(p))))
109 109
110 tars : all $(TARFILES) 110 tars : all $(TARFILES)
111 onlytars : $(TARFILES) 111 onlytars : $(TARFILES)
112 %.tar.gz : 112 %.tar.gz :
113 @echo 'Creating compiler package $@' 113 @echo 'Creating compiler package $@'
114 cd $(RESULT)/$(PLATFORM) && tar -czf $@ * 114 cd $(RESULT)/$(PLATFORM) && tar -czf $@ *
115 touch $@ 115 touch $@
116 116
117 clean : 117 clean :
118 rm -rf build result 118 rm -rf build result
119 119
120 FORCE : 120 FORCE :
121 .PHONY : $(configs) $(platforms) 121 .PHONY : $(configs) $(platforms)
122
123

mercurial