summaryrefslogtreecommitdiffstats
path: root/make/variant/darwin.defs
blob: 4c9d06bb26c7666e1313eb03e950d3e22b7ecacf (plain)
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
UB.archs  = i386 x86_64 ppc ppc64
UB.builds = $(wildcard $(foreach n,$(UB.archs),$(SRC/)build.$n))
UB.first  = $(word 1,$(UB.archs))
UB.other  = $(wordlist 2,999,$(UB.archs))

UB.BUILD = $(SRC/)configure --force --build=ub.$(1) --arch=$(1) --launch --launch-quiet

## linefeed is important
define UB.BUILD.item
	$(call UB.BUILD,$(1)) --launch-jobs=0

endef

define UB.BUILD.SERIAL
	$(foreach n,$(UB.archs),$(call UB.BUILD.item,$n))
endef

define UB.BUILD.PARALLEL
	$(call UB.BUILD,$(1)) >/dev/null 2>&1
endef

define UB.COMBINE
	$(RM.exe) -fr ub.combine
	$(MKDIR.exe) -p ub.combine
	$(CP.exe) ub.$(UB.first)/HandBrakeCLI ub.combine/.
	$(LIPO.exe) $(foreach n,$(UB.archs),ub.$n/HandBrakeCLI) -create -output ub.combine/HandBrakeCLI
	$(CP.exe) -R ub.$(UB.first)/HandBrake.app ub.combine/.
	$(LIPO.exe) $(foreach n,$(UB.archs),ub.$n/$(1)) -create -output ub.combine/$(1)
	@lipo -info ub.combine/$(1)
	@sync
	@echo ""
	@echo "$@: { $(UB.archs) } combined -> ub.combine/HandBrakeCLI"
	@echo "$@: UB executable size: `du -sh ub.combine/HandBrakeCLI | awk '{ print $$1 }'`"
	@echo ""
	@echo "$@: { $(UB.archs) } combined -> ub.combine/HandBrake.app"
	@echo "$@: UB executable size: `du -sh ub.combine/$(1) | awk '{ print $$1 }'`"
endef