OSDN Git Service

BuildSystem: conversion from jam-based to make-based system.
[handbrake-jp/handbrake-jp-git.git] / make / variant / darwin.defs
1 ## UB build support
2 ##
3 ## PROCEDURE:
4 ##
5 ##  1. Perform a build (let us call it arch-X).
6 ##  2. cd into arch-X's build/ driectory.
7 ##  3. Launch builds of the remaining architectures.
8 ##     We compute $(UB.archs.other) to be the remaining archs to build.
9 ##     The entire list is defined $(UB.archs) .
10 ##  4. Combine other architectures into arch-X's binaries.
11 ##
12 ## EXAMPLE: serial method, archs: i386,x86_64,ppc,ppc64
13 ##
14 ##  ./configure --launch
15 ##  cd build/
16 ##  make ub.build.serial
17 ##  make ub.combine
18 ##
19 ## EXAMPLE: parallel method, archs: i386,x86_64,ppc,ppc64
20 ##
21 ##  ./configure --launch
22 ##  cd build/
23 ##  make ub.build.parallel
24 ##  make ub.combine
25 ##
26 ## EXAMPLE: serial, archs: i386,x86_64 (assuming i386 is native)
27 ##
28 ##  ./configure --launch
29 ##  cd build/
30 ##  make ub.build.parallel UB.archs="i386 x86_64"
31 ##  make ub.combine UB.archs="i386 x86_64"
32 ##
33 UB.archs       = i386 x86_64 ppc ppc64
34 UB.archs.other = $(filter-out $(BUILD.arch),$(UB.archs))
35 UB.builds      = $(wildcard $(foreach n,$(UB.archs.other),$(PROJECT/)build.$n))
36
37 UB.BUILD = $(PROJECT/)configure --launch --launch-dir=ub.$(1) --arch=$(1)
38
39 ## linefeed is important
40 define UB.BUILD.item
41         $(call UB.BUILD,$(1))
42
43 endef
44
45 define UB.BUILD.SERIAL
46         $(foreach n,$(UB.archs.other),$(call UB.BUILD.item,$n))
47 endef
48
49 define UB.BUILD.PARALLEL
50         $(call UB.BUILD,$(1)) 2>&1 > ub.$(1).log
51 endef
52
53 define UB.COMBINE
54         $(RM.exe) -fr ub.combine
55         $(MKDIR.exe) -p ub.combine
56         $(CP.exe) -R HandBrake.app ub.combine/.
57         lipo $(1) $(foreach n,$(UB.archs.other),ub.$n/$(1)) -create -output ub.combine/$(1)
58         @echo ""
59         @sync; lipo -info ub.combine/$(1)
60         @du -sh ub.combine/$(1)
61 endef