1
2Description := Target for Darwin using an Apple-style build.
3
4Configs := Debug Release Profile Static
5
6# We override this with RC_ARCHS because B&I may want to build on an ARCH we
7# haven't explicitly defined support for. If all goes well, this will just work
8# and the resulting lib will just have generic versions for anything unknown.
9UniversalArchs := $(RC_ARCHS)
10
11ifneq (,$(SDKROOT))
12	override CC := $(shell xcrun -sdk $(SDKROOT) -find clang || echo "false") 
13	AR := $(shell xcrun -sdk $(SDKROOT) -find ar || echo "false") 
14	RANLIB := $(shell xcrun -sdk $(SDKROOT) -find ranlib || echo "false") 
15	STRIP := $(shell xcrun -sdk $(SDKROOT) -find strip || echo "false") 
16	LIPO := $(shell xcrun -sdk $(SDKROOT) -find lipo || echo "false")
17	DSYMUTIL := $(shell xcrun -sdk $(SDKROOT) -find dsymutil || echo "false")
18endif
19
20ifneq ($(IPHONEOS_DEPLOYMENT_TARGET),)
21	DEPLOYMENT_FLAGS := -miphoneos-version-min=$(IPHONEOS_DEPLOYMENT_TARGET) 
22else
23	ifneq ($(MACOSX_DEPLOYMENT_TARGET),)
24		DEPLOYMENT_FLAGS := -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) 
25	endif
26endif
27
28ifneq (,$(SDKROOT))
29	DEPLOYMENT_FLAGS += -isysroot $(SDKROOT)
30endif
31
32CFLAGS := -Wall -Os -fomit-frame-pointer -g $(DEPLOYMENT_FLAGS)
33CFLAGS.Static := $(CFLAGS) -static  
34DYLIB_FLAGS := $(DEPLOYMENT_FLAGS) \
35		-Xarch_arm -Wl,-alias_list,$(SRCROOT)/lib/builtins/arm/softfloat-alias.list
36
37VISIBILITY_HIDDEN := 0
38VISIBILITY_HIDDEN.Static  := 1
39
40
41FUNCTIONS := absvdi2 absvsi2 addvdi3 addvsi3 ashldi3 ashrdi3 \
42             clzdi2 clzsi2 cmpdi2 ctzdi2 ctzsi2 \
43             divdc3 divdi3 divsc3 ffsdi2 \
44             fixdfdi fixsfdi fixunsdfdi fixunsdfsi fixunssfdi \
45             fixunssfsi floatdidf floatdisf floatundidf floatundisf \
46             gcc_personality_v0 lshrdi3 moddi3 muldc3 muldi3 mulosi4 \
47             mulodi4 muloti4 mulsc3 mulvdi3 mulvsi3 negdi2 negvdi2 negvsi2 \
48             paritydi2 paritysi2 popcountdi2 popcountsi2 powidf2 \
49             powisf2 subvdi3 subvsi3 ucmpdi2 udivdi3 \
50             udivmoddi4 umoddi3 apple_versioning eprintf atomic \
51             atomic_flag_clear atomic_flag_clear_explicit \
52             atomic_flag_test_and_set atomic_flag_test_and_set_explicit \
53             atomic_signal_fence atomic_thread_fence \
54             extendhfsf2 truncdfhf2 truncsfhf2 
55
56FUNCTIONS.i386 := $(FUNCTIONS) \
57                divxc3 fixunsxfdi fixunsxfsi fixxfdi floatdixf \
58                floatundixf mulxc3 powixf2 clear_cache \
59                enable_execute_stack
60FUNCTIONS.ppc := $(FUNCTIONS) \
61                divtc3 fixtfdi fixunstfdi floatditf floatunditf \
62                gcc_qadd gcc_qdiv gcc_qmul gcc_qsub multc3 \
63                powitf2 restFP saveFP trampoline_setup \
64                clear_cache enable_execute_stack
65FUNCTIONS.x86_64 := $(FUNCTIONS) \
66                absvti2 addvti3 ashlti3 ashrti3 clzti2 cmpti2 \
67                ctzti2 divti3 divxc3 ffsti2 fixdfti fixsfti \
68                fixunsdfti fixunssfti fixunsxfdi fixunsxfsi \
69                fixunsxfti fixxfdi fixxfti floatdixf floattidf \
70                floattisf floattixf floatundixf floatuntidf \
71                floatuntisf floatuntixf lshrti3 modti3 multi3 \
72                muloti4 mulvti3 mulxc3 negti2 negvti2 parityti2 \
73                popcountti2 powixf2 subvti3 ucmpti2 udivmodti4 \
74                udivti3 umodti3 clear_cache enable_execute_stack
75
76FUNCTIONS.armv4t := $(FUNCTIONS) 
77
78FUNCTIONS.armv5 := $(FUNCTIONS) \
79                adddf3 addsf3 bswapdi2 bswapsi2  \
80                comparedf2 comparesf2 extendsfdf2 \
81                divdf3 divsf3 \
82                fixdfsi fixsfsi fixunsdfsi fixunssfsi \
83                floatsidf floatsisf floatunsidf floatunsisf \
84                muldf3 mulsf3 \
85                negdf2 negsf2 \
86                truncdfsf2  \
87                modsi3 umodsi3 udivsi3 divsi3 udivmodsi4 divmodsi4 \
88                switch8 switchu8 switch16 switch32 \
89                sync_synchronize
90
91FUNCTIONS.armv6 := $(FUNCTIONS) \
92				comparedf2 comparesf2 \
93                adddf3vfp addsf3vfp bswapdi2 bswapsi2 divdf3vfp \
94                divsf3vfp eqdf2vfp eqsf2vfp extendsfdf2vfp \
95                fixdfsivfp fixsfsivfp fixunsdfsivfp fixunssfsivfp \
96                floatsidfvfp floatsisfvfp floatunssidfvfp floatunssisfvfp \
97                gedf2vfp gesf2vfp gtdf2vfp gtsf2vfp \
98                ledf2vfp lesf2vfp ltdf2vfp ltsf2vfp \
99                muldf3vfp mulsf3vfp \
100                nedf2vfp nesf2vfp \
101                subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
102                modsi3 umodsi3 udivsi3 divsi3 udivmodsi4 divmodsi4 \
103                switch8 switchu8 switch16 switch32 \
104                restore_vfp_d8_d15_regs save_vfp_d8_d15_regs \
105                sync_synchronize
106
107FUNCTIONS.armv7 := $(FUNCTIONS) \
108				comparedf2 comparesf2 \
109                adddf3vfp addsf3vfp bswapdi2 bswapsi2 divdf3vfp \
110                divsf3vfp eqdf2vfp eqsf2vfp extendsfdf2vfp \
111                fixdfsivfp fixsfsivfp fixunsdfsivfp fixunssfsivfp \
112                floatsidfvfp floatsisfvfp floatunssidfvfp floatunssisfvfp \
113                gedf2vfp gesf2vfp gtdf2vfp gtsf2vfp \
114                ledf2vfp lesf2vfp ltdf2vfp ltsf2vfp \
115                muldf3vfp mulsf3vfp \
116                nedf2vfp nesf2vfp \
117                subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
118                modsi3 umodsi3 udivsi3 divsi3 udivmodsi4 divmodsi4
119
120FUNCTIONS.armv7s := $(FUNCTIONS.armv7)
121
122FUNCTIONS.arm64 :=  divti3 modti3 \
123					udivmodti4 \
124					udivti3 umodti3 \
125					mulsc3 muldc3 \
126					powisf2 powidf2 \
127					clzti2 \
128					fixdfti fixsfti \
129					fixunsdfti fixunssfti fixunssfti \
130					floattidf floattisf floatuntidf floatuntisf \
131					gcc_personality_v0 atomic \
132					atomic_flag_clear atomic_flag_clear_explicit \
133					atomic_flag_test_and_set \
134					atomic_flag_test_and_set_explicit \
135					atomic_signal_fence atomic_thread_fence
136