]> git.saurik.com Git - apple/configd.git/blob - nwi/Makefile
configd-1109.101.1.tar.gz
[apple/configd.git] / nwi / Makefile
1 ifeq ($(PLATFORM),iphoneos)
2 # iOS internal SDK
3 ARCHS=armv7
4 endif
5
6 ifeq ($(PLATFORM),)
7 PLATFORM=macosx
8 endif
9
10 ifeq ($(PLATFORM),macosx)
11 # Mac OS X internal SDK
12 ARCHS=x86_64
13 endif
14
15 # Mac OS X or iOS internal SDK
16 SDK=$(PLATFORM).internal
17 SYSROOT=$(shell xcodebuild -version -sdk $(SDK) Path)
18 CC = xcrun -sdk $(SDK) cc
19 PF_INC = -F$(SYSROOT)/System/Library/PrivateFrameworks
20
21 ARCH_FLAGS=$(foreach a,$(ARCHS),-arch $(a))
22 EXTRA_CFLAGS=
23 TEST_INCLUDE=-I. -I../dnsinfo -I../libSystemConfiguration -I../SystemConfiguration.fproj -I$(SYSROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
24
25 REFERENCE_OUTPUT=../common/reference_output.sh
26
27 clean:
28 rm -rf test_nwi *.o *.dSYM
29
30 test_nwi:network_information.c network_information_priv.c ../libSystemConfiguration/libSystemConfiguration_client.c
31 $(CC) -DTEST_NWI $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) $(TEST_INCLUDE) $(EXTRA_CFLAGS) -Wall -O0 -g -o $@ $^
32
33 test_nwi_reference.txt: test_nwi
34 sh $(REFERENCE_OUTPUT) create test_nwi test_nwi_reference.txt /bin/cat
35
36 test_nwi_test: test_nwi
37 sh $(REFERENCE_OUTPUT) test test_nwi test_nwi_reference.txt /bin/cat
38
39 nwi:network_information.c network_information_priv.c ../libSystemConfiguration/libSystemConfiguration_client.c
40 $(CC) -DTEST_NWI_STATE $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) $(TEST_INCLUDE) $(EXTRA_CFLAGS) -Wall -O0 -g -o $@ $^