summaryrefslogtreecommitdiffstats
path: root/macosx/module.defs
blob: 5d22164f639ba83a043803be370ac5957762a369 (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
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
$(eval $(call import.MODULE.defs,MACOSX,macosx))
$(eval $(call import.GCC,MACOSX))

MACOSX.src/   = $(SRC/)macosx/
MACOSX.build/ = $(BUILD/)macosx/

MACOSX.m4.in  = $(wildcard $(MACOSX.src/)*.m4)
MACOSX.m4.out = $(MACOSX.m4.in:$(MACOSX.src/)%.m4=$(MACOSX.build/)%)

###############################################################################

BUILD.out += $(MACOSX.m4.out)
BUILD.out += $(MACOSX.m4.wc.out)

###############################################################################

MACOSX.project = -project $(MACOSX.src/)HandBrake.xcodeproj

## configuration: must be one of { release, debug }
MACOSX.configuration = -configuration $(MACOSX.map.g.$(MACOSX.GCC.g))

## mapping from symbolic debug value to xcode configuration
MACOSX.map.g.none = release
MACOSX.map.g.min  = debug
MACOSX.map.g.std  = debug
MACOSX.map.g.max  = debug

ifeq (1,$(FEATURE.fdk_aac))
    extra_libs += $(abspath $(BUILD))/contrib/lib/libfdk-aac.a
endif

ifeq (1,$(FEATURE.faac))
    extra_libs += $(abspath $(BUILD))/contrib/lib/libfaac.a
endif

ifeq (1,$(FEATURE.mp4v2))
    extra_libs += $(abspath $(BUILD))/contrib/lib/libmp4v2.a
endif

ifeq (1,$(FEATURE.libmkv))
    extra_libs += $(abspath $(BUILD))/contrib/lib/libmkv.a
endif
MACOSX.extra_ldflags = OTHER_LDFLAGS='$(extra_libs)'

## xcconfig: must be one of macosx/xcconfig/*.xcconfig
MACOSX.xcconfig = $(foreach x,$(XCODE.xcconfig),-xcconfig $(MACOSX.src/)xcconfig/$(x))
MACOSX.sdk      = $(foreach sdk,$(GCC.sysroot),-sdk $(sdk))

## launch a build thru xcode; which in turn will do a nested make against
## this build system with normal build rules enabled.
##
## $(1) = list of targets
## $(2) = list of goals to shunt thru xcodebuild->make
##

MACOSX.XCODE = $(strip \
    $(XCODEBUILD.exe) \
        $(MACOSX.project) \
        $(foreach t,$(1),-target $t) \
        $(MACOSX.configuration) \
        $(MACOSX.xcconfig) \
        \
        SYMROOT='$(XCODE.symroot)' \
        CONFIGURATION_BUILD_DIR='$(XCODE.symroot)' \
        CONFIGURATION_TEMP_DIR='$(XCODE.symroot)' \
        \
        EXTERNAL_BUILD='$(abspath $(BUILD))' \
        EXTERNAL_CONF_ARGS='$(CONF.args)' \
        EXTERNAL_DRIVER='$(XCODE.driver)' \
        EXTERNAL_GOALS='$(3)' \
        EXTERNAL_JOBS='$(BUILD.jobs)' \
        EXTERNAL_VARS='$(-*-command-variables-*-)' \
        \
        $(MACOSX.extra_ldflags) \
        \
        $(2) )