1# Default platform uses the native SDK.
2# To build for Mac OS X using internal SDK, use 'make PLATFORM=macosx <target>'
3# To build for iOS, use 'make PLATFORM=iphoneos <target>'
4
5WIFI_FRAMEWORK=-framework CoreWLAN
6ifeq ($(PLATFORM),iphoneos)
7# iOS internal SDK
8CORETELEPHONY=-framework CoreTelephony
9ARCHS=armv7
10WIFI_FRAMEWORK=-framework MobileWiFi -lio80211
11endif
12
13ifeq ($(PLATFORM),macosx)
14# Mac OS X internal SDK
15ARCHS=i386 x86_64
16CORETELEPHONY=
17endif
18
19ifeq ($(PLATFORM),)
20# Mac OS X native SDK
21ARCHS=x86_64
22CORETELEPHONY=
23CC = cc
24SYSROOT = /
25PF_INC = -F/System/Library/PrivateFrameworks
26else
27# Mac OS X or iOS internal SDK
28SDK=$(PLATFORM).internal
29SYSROOT=$(shell xcodebuild -version -sdk $(SDK) Path)
30CC = xcrun -sdk $(SDK) cc
31PF_INC = -F$(SYSROOT)/System/Library/PrivateFrameworks
32endif
33
34ARCH_FLAGS=$(foreach a,$(ARCHS),-arch $(a))
35
36w: wireless.m
37	cc -DTEST_WIRELESS_M -I../EAP8021X.fproj -g -o $@ $^ $(PF_INC) -framework CoreWLAN -framework Foundation
38
39wireless: wireless.c wireless.m
40	$(CC) $(ARCH_FLAGS) -DUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS -I../EAP8021X.fproj -DTEST_WIRELESS -g -o $@ $^ $(PF_INC) $(WIFI_FRAMEWORK) -framework Foundation -framework EAP8021X -framework SystemConfiguration
41
42wireless_p: wireless.c
43	$(CC) $(ARCH_FLAGS) -DUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS -I../EAP8021X.fproj -DTEST_WIRELESS -g -o $@ $^ $(PF_INC) $(WIFI_FRAMEWORK) -framework Foundation -framework EAP8021X -framework SystemConfiguration
44	codesign -s - -f --entitlements entitlements.plist $@
45
46Dialogue: Dialogue.c
47	cc -Wall -DTEST_DIALOGUE -g -o Dialogue Dialogue.c mylog.c -I../EAP8021X.fproj ../EAP8021X.fproj/myCFUtil.c -framework CoreFoundation -framework SystemConfiguration -framework EAP8021X -F/System/Library/PrivateFrameworks -framework Security
48
49InterestNotification: InterestNotification.c
50	cc -DTEST_INTERESTNOTIFICATION -Wall -g -o InterestNotification InterestNotification.c -framework CoreFoundation -framework IOKit
51
52InterestNotification_p: InterestNotification.c
53	$(CC) -arch armv6 -isysroot $(SYSROOT) -I../EAP8021X.fproj -DTEST_INTERESTNOTIFICATION -Wall -g -o InterestNotification_p InterestNotification.c -framework CoreFoundation -framework IOKit
54
55clean:
56	rm -f Dialogue wireless_p wireless InterestNotification InterestNotification_p
57	rm -rf *.dSYM/
58