]> git.saurik.com Git - apple/configd.git/blob - Plugins/IPMonitor/Makefile
configd-802.40.13.tar.gz
[apple/configd.git] / Plugins / IPMonitor / 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
23 EXTRA_CFLAGS=
24 TEST_INCLUDE=-I. -I../common -I../../dnsinfo -I../../nwi -I../../libSystemConfiguration -I../../SystemConfiguration.fproj -I../../IPMonitorControl -I$(SYSROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
25
26 REFERENCE_OUTPUT=../../common/reference_output.sh
27
28 all: test_ipv4_routelist test_ipv6_routelist
29
30 # ----------
31
32 dnsinfo_create.o: ../../dnsinfo/dnsinfo_create.h ../../dnsinfo/dnsinfo_create.c
33 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../dnsinfo/dnsinfo_create.c
34
35 dnsinfo_flatfile.o: ../../dnsinfo/dnsinfo_copy.c ../../dnsinfo/dnsinfo_flatfile.c
36 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -D_PATH_RESOLVER_DIR='"/var/tmp/resolver"' -Wall -O0 -g -c ../../dnsinfo/dnsinfo_flatfile.c
37
38 dnsinfo_server.o: ../../dnsinfo/dnsinfo_copy.c ../../dnsinfo/dnsinfo_server.c
39 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../dnsinfo/dnsinfo_server.c
40
41 dns-configuration.o: dns-configuration.h dns-configuration.c dnsinfo_create.o
42 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c dns-configuration.c
43
44 network_information_priv.o: ../../nwi/network_information_priv.h ../../nwi/network_information_priv.c
45 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../nwi/network_information_priv.c
46
47 network_information_server.o: ../../nwi/network_information_server.h ../../nwi/network_information_server.c
48 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../nwi/network_information_server.c
49
50 proxy-configuration.o: proxy-configuration.h proxy-configuration.c
51 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c proxy-configuration.c
52
53 set-hostname.o: set-hostname.c
54 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c set-hostname.c
55
56 smb-configuration.o: smb-configuration.c
57 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c smb-configuration.c
58
59 libSystemConfiguration_client.o: ../../libSystemConfiguration/libSystemConfiguration_client.h ../../libSystemConfiguration/libSystemConfiguration_client.c
60 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../libSystemConfiguration/libSystemConfiguration_client.c
61
62 libSystemConfiguration_server.o: ../../libSystemConfiguration/libSystemConfiguration_server.h ../../libSystemConfiguration/libSystemConfiguration_server.c
63 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../libSystemConfiguration/libSystemConfiguration_server.c
64
65 IPMonitorControlPrefs.o: ../common/IPMonitorControlPrefs.h ../common/IPMonitorControlPrefs.c
66 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../common/IPMonitorControlPrefs.c
67
68 IPMonitorControlServer.o: ../../IPMonitorControl/IPMonitorControlServer.c
69 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c $^
70
71 # ----------
72
73 dns-configurationX.o: Makefile dns-configuration.h dns-configuration.c dnsinfo_create.o
74 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o dns-configurationX.o dns-configuration.c
75
76 ip_pluginX.o: Makefile ip_plugin.c
77 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_DNS ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o ip_pluginX.o ip_plugin.c
78
79 test_dns: Makefile dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o ip_pluginX.o IPMonitorControlPrefs.o network_information_priv.o network_information_server.o dns-configurationX.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o IPMonitorControlServer.o
80 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_dns dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o ip_pluginX.o IPMonitorControlPrefs.o network_information_priv.o network_information_server.o dns-configurationX.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o IPMonitorControlServer.o -framework SystemConfiguration -framework CoreFoundation
81
82 # ----------
83
84 test_proxy: Makefile proxy-configuration.h proxy-configuration.c
85 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN -DDEBUG -Wall -O0 -g -o test_proxy proxy-configuration.c ${EXTRA_CFLAGS} -framework SystemConfiguration -framework CoreFoundation
86
87 # ----------
88
89 set-hostnameX.o: Makefile set-hostname.h set-hostname.c
90 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN -DDEBUG ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o set-hostnameX.o set-hostname.c
91
92 test_hostname: Makefile dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o ip_pluginX.o IPMonitorControlPrefs.o network_information_priv.o network_information_server.o dns-configuration.o smb-configuration.o proxy-configuration.o set-hostnameX.o libSystemConfiguration_client.o libSystemConfiguration_server.o IPMonitorControlServer.o
93 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_hostname dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o ip_pluginX.o IPMonitorControlPrefs.o network_information_priv.o network_information_server.o dns-configuration.o smb-configuration.o proxy-configuration.o set-hostnameX.o libSystemConfiguration_client.o libSystemConfiguration_server.o IPMonitorControlServer.o ${EXTRA_CFLAGS} -framework SystemConfiguration -framework CoreFoundation
94
95 # ----------
96
97 smb-configurationX.o: smb-configuration.h smb-configuration.c
98 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN -DDEBUG ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o smb-configurationX.o smb-configuration.c
99
100 test_smb: Makefile dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o ip_pluginX.o IPMonitorControlPrefs.o network_information_priv.o network_information_server.o dns-configuration.o smb-configurationX.o proxy-configuration.o set-hostname.o libSystemConfiguration_client.o libSystemConfiguration_server.o IPMonitorControlServer.o
101 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_smb dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o ip_pluginX.o IPMonitorControlPrefs.o network_information_priv.o network_information_server.o dns-configuration.o smb-configurationX.o proxy-configuration.o set-hostname.o libSystemConfiguration_client.o libSystemConfiguration_server.o IPMonitorControlServer.o ${EXTRA_CFLAGS} -framework SystemConfiguration -framework CoreFoundation
102
103 # ----------
104
105 test_ipv4_routelist.o: ip_plugin.c
106 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_IPV4_ROUTELIST ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o $@ $^
107
108 test_ipv4_routelist: test_ipv4_routelist.o IPMonitorControlPrefs.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o network_information_priv.o network_information_server.o smb-configuration.o proxy-configuration.o libSystemConfiguration_server.o IPMonitorControlServer.o
109 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wformat -Wall -O0 -g -o $@ $^ ${EXTRA_CFLAGS} -framework SystemConfiguration -framework CoreFoundation
110
111 test_ipv4_routelist_reference.txt: test_ipv4_routelist
112 sh $(REFERENCE_OUTPUT) create test_ipv4_routelist test_ipv4_routelist_reference.txt routelist_output_filter.sh
113
114 test_ipv4_routelist_test: test_ipv4_routelist
115 sh $(REFERENCE_OUTPUT) test test_ipv4_routelist test_ipv4_routelist_reference.txt routelist_output_filter.sh
116
117 test_ipv4_routelist_coverage: test_ipv4_routelist
118 test_ipv4_routelist -1 | grep Hit | awk '{print $$2}' | sort | uniq
119
120 # ----------
121
122 test_ipv6_routelist.o: ip_plugin.c
123 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_IPV6_ROUTELIST ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o $@ $^
124
125 test_ipv6_routelist: test_ipv6_routelist.o IPMonitorControlPrefs.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o network_information_priv.o network_information_server.o smb-configuration.o proxy-configuration.o libSystemConfiguration_server.o IPMonitorControlServer.o
126 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wformat -Wall -O0 -g -o $@ $^ ${EXTRA_CFLAGS} -framework SystemConfiguration -framework CoreFoundation
127
128 test_ipv6_routelist_reference.txt: test_ipv6_routelist
129 sh $(REFERENCE_OUTPUT) create test_ipv6_routelist test_ipv6_routelist_reference.txt routelist_output_filter.sh
130
131 test_ipv6_routelist_test: test_ipv6_routelist
132 sh $(REFERENCE_OUTPUT) test test_ipv6_routelist test_ipv6_routelist_reference.txt routelist_output_filter.sh
133
134 test_ipv6_routelist_coverage: test_ipv6_routelist
135 test_ipv6_routelist -1 | grep Hit | awk '{print $$2}' | sort | uniq
136
137 # ----------
138
139 IPMonitor.o: ip_plugin.c
140 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_IPMONITOR ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o IPMonitor.o ip_plugin.c
141
142 IPMonitor: IPMonitor.o IPMonitorControlPrefs.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o network_information_priv.o network_information_server.o proxy-configuration.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o
143 $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o IPMonitor IPMonitor.o IPMonitorControlPrefs.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o network_information_priv.o network_information_server.o proxy-configuration.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o ${EXTRA_CFLAGS} -framework SystemConfiguration -framework CoreFoundation
144
145 # ----------
146
147 clean:
148 rm -rf *.dSYM *.o test_dns test_hostname test_proxy test_smb test_ipv4_routelist test_ipv6_routelist IPMonitor