]>
Commit | Line | Data |
---|---|---|
9de8ab86 A |
1 | ifeq ($(PLATFORM),iphoneos) |
2 | # iOS internal SDK | |
afb19109 | 3 | ARCHS=arm64 |
9de8ab86 A |
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) | |
c956c85e | 18 | CC = xcrun -sdk $(SDK) clang |
9de8ab86 A |
19 | PF_INC = -F$(SYSROOT)/System/Library/PrivateFrameworks |
20 | ||
21 | ARCH_FLAGS=$(foreach a,$(ARCHS),-arch $(a)) | |
22 | ||
c956c85e A |
23 | EXTRA_CFLAGS=-fsanitize=address |
24 | #EXTRA_CFLAGS= | |
25 | ||
afb19109 | 26 | TEST_INCLUDE=-I. -I../common -I../../dnsinfo -I../../nwi -I../../libSystemConfiguration -I../../SystemConfiguration.fproj -I../../IPMonitorControl -I../../IPMonitorControl/AWD -I$(SYSROOT)/System/Library/Frameworks/System.framework/PrivateHeaders |
6bb65964 | 27 | |
9de8ab86 | 28 | REFERENCE_OUTPUT=../../common/reference_output.sh |
6bb65964 | 29 | |
78403150 | 30 | all: test_ipv4_routelist test_ipv6_routelist |
6bb65964 | 31 | |
5e9ce69e | 32 | # ---------- |
6bb65964 | 33 | |
942cecd7 A |
34 | agent-monitor.o: agent-monitor.m |
35 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c agent-monitor.m | |
36 | ||
37 | configAgent.o: configAgent.m | |
38 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c configAgent.m | |
39 | ||
40 | controller.o: controller.m | |
41 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c controller.m | |
42 | ||
43 | dnsAgent.o: dnsAgent.m | |
44 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c dnsAgent.m | |
45 | ||
46 | proxyAgent.o: proxyAgent.m | |
47 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c proxyAgent.m | |
48 | ||
5e9ce69e | 49 | dnsinfo_create.o: ../../dnsinfo/dnsinfo_create.h ../../dnsinfo/dnsinfo_create.c |
9de8ab86 | 50 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../dnsinfo/dnsinfo_create.c |
6bb65964 | 51 | |
5e9ce69e | 52 | dnsinfo_flatfile.o: ../../dnsinfo/dnsinfo_copy.c ../../dnsinfo/dnsinfo_flatfile.c |
9de8ab86 | 53 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -D_PATH_RESOLVER_DIR='"/var/tmp/resolver"' -Wall -O0 -g -c ../../dnsinfo/dnsinfo_flatfile.c |
6bb65964 | 54 | |
5e9ce69e | 55 | dnsinfo_server.o: ../../dnsinfo/dnsinfo_copy.c ../../dnsinfo/dnsinfo_server.c |
9de8ab86 | 56 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../dnsinfo/dnsinfo_server.c |
6bb65964 A |
57 | |
58 | dns-configuration.o: dns-configuration.h dns-configuration.c dnsinfo_create.o | |
9de8ab86 | 59 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c dns-configuration.c |
17d3ee29 | 60 | |
c956c85e A |
61 | nat64-configuration.o: nat64-configuration.h nat64-configuration.c |
62 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c nat64-configuration.c | |
63 | ||
942cecd7 A |
64 | network_state_information_priv.o: ../../nwi/network_state_information_priv.h ../../nwi/network_state_information_priv.c |
65 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../nwi/network_state_information_priv.c | |
5e9ce69e A |
66 | |
67 | network_information_server.o: ../../nwi/network_information_server.h ../../nwi/network_information_server.c | |
9de8ab86 | 68 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../nwi/network_information_server.c |
6bb65964 A |
69 | |
70 | proxy-configuration.o: proxy-configuration.h proxy-configuration.c | |
9de8ab86 | 71 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c proxy-configuration.c |
5e9ce69e A |
72 | |
73 | set-hostname.o: set-hostname.c | |
9de8ab86 | 74 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c set-hostname.c |
6bb65964 A |
75 | |
76 | smb-configuration.o: smb-configuration.c | |
9de8ab86 | 77 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c smb-configuration.c |
5e9ce69e A |
78 | |
79 | libSystemConfiguration_client.o: ../../libSystemConfiguration/libSystemConfiguration_client.h ../../libSystemConfiguration/libSystemConfiguration_client.c | |
9de8ab86 | 80 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../libSystemConfiguration/libSystemConfiguration_client.c |
5e9ce69e A |
81 | |
82 | libSystemConfiguration_server.o: ../../libSystemConfiguration/libSystemConfiguration_server.h ../../libSystemConfiguration/libSystemConfiguration_server.c | |
9de8ab86 | 83 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../../libSystemConfiguration/libSystemConfiguration_server.c |
5e9ce69e A |
84 | |
85 | IPMonitorControlPrefs.o: ../common/IPMonitorControlPrefs.h ../common/IPMonitorControlPrefs.c | |
9de8ab86 | 86 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c ../common/IPMonitorControlPrefs.c |
6bb65964 | 87 | |
78403150 | 88 | IPMonitorControlServer.o: ../../IPMonitorControl/IPMonitorControlServer.c |
9de8ab86 | 89 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) ${TEST_INCLUDE} -Wall -O0 -g -c $^ |
78403150 | 90 | |
6bb65964 A |
91 | # ---------- |
92 | ||
78403150 | 93 | ip_pluginX.o: Makefile ip_plugin.c |
9de8ab86 | 94 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_DNS ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o ip_pluginX.o ip_plugin.c |
5e9ce69e | 95 | |
942cecd7 A |
96 | # ---------- |
97 | ||
98 | dns-configurationX.o: Makefile dns-configuration.h dns-configuration.c dnsinfo_create.o | |
99 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o dns-configurationX.o dns-configuration.c | |
100 | ||
c956c85e A |
101 | test_dns: ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configurationX.o nat64-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o |
102 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_dns ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configurationX.o nat64-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o ${EXTRA_CFLAGS} -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework CoreServices -framework Foundation -framework Network -framework NetworkExtension | |
6bb65964 A |
103 | |
104 | # ---------- | |
105 | ||
942cecd7 A |
106 | proxy-configurationX.o: Makefile proxy-configuration.h proxy-configuration.c |
107 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o proxy-configurationX.o proxy-configuration.c | |
108 | ||
c956c85e A |
109 | test_proxy: ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o nat64-configuration.o proxy-configurationX.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o |
110 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_proxy ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o nat64-configuration.o proxy-configurationX.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o ${EXTRA_CFLAGS} -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework CoreServices -framework Foundation -framework Network -framework NetworkExtension | |
6bb65964 A |
111 | |
112 | # ---------- | |
a40a14f8 | 113 | |
78403150 | 114 | set-hostnameX.o: Makefile set-hostname.h set-hostname.c |
9de8ab86 | 115 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN -DDEBUG ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o set-hostnameX.o set-hostname.c |
78403150 | 116 | |
c956c85e A |
117 | test_hostname: ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o nat64-configuration.o proxy-configuration.o set-hostnameX.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o |
118 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_hostname ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o nat64-configuration.o proxy-configuration.o set-hostnameX.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o ${EXTRA_CFLAGS} -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework CoreServices -framework Foundation -framework Network -framework NetworkExtension | |
78403150 A |
119 | |
120 | # ---------- | |
121 | ||
5e9ce69e | 122 | smb-configurationX.o: smb-configuration.h smb-configuration.c |
9de8ab86 | 123 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DMAIN -DDEBUG ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o smb-configurationX.o smb-configuration.c |
5e9ce69e | 124 | |
c956c85e A |
125 | test_smb: ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o nat64-configuration.o proxy-configuration.o set-hostname.o smb-configurationX.o libSystemConfiguration_client.o libSystemConfiguration_server.o |
126 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_smb ip_pluginX.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o nat64-configuration.o proxy-configuration.o set-hostname.o smb-configurationX.o libSystemConfiguration_client.o libSystemConfiguration_server.o ${EXTRA_CFLAGS} -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework CoreServices -framework Foundation -framework Network -framework NetworkExtension | |
942cecd7 A |
127 | |
128 | # ---------- | |
129 | ||
130 | test_dns_order.o: ip_plugin.c | |
131 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_DNS_ORDER ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o $@ $^ | |
132 | ||
c956c85e A |
133 | test_dns_order: test_dns_order.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o nat64-configuration.o |
134 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o $@ test_dns_order.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o nat64-configuration.o $(EXTRA_CFLAGS) -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework Foundation -framework Network -framework NetworkExtension -framework CoreServices | |
a40a14f8 | 135 | |
6bb65964 | 136 | # ---------- |
c956c85e | 137 | |
6bb65964 | 138 | test_ipv4_routelist.o: ip_plugin.c |
9de8ab86 | 139 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_IPV4_ROUTELIST ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o $@ $^ |
6bb65964 | 140 | |
8004eb02 | 141 | test_ipv4_routelist: test_ipv4_routelist.o IPMonitorControlPrefs.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o |
c956c85e | 142 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_ipv4_routelist $^ ${EXTRA_CFLAGS} -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework Foundation -framework Network -framework NetworkExtension -framework CoreServices |
a40a14f8 A |
143 | |
144 | test_ipv4_routelist_reference.txt: test_ipv4_routelist | |
afb19109 | 145 | sh $(REFERENCE_OUTPUT) create ./test_ipv4_routelist test_ipv4_routelist_reference.txt routelist_output_filter.sh |
a40a14f8 A |
146 | |
147 | test_ipv4_routelist_test: test_ipv4_routelist | |
afb19109 | 148 | sh $(REFERENCE_OUTPUT) test ./test_ipv4_routelist test_ipv4_routelist_reference.txt routelist_output_filter.sh |
78403150 A |
149 | |
150 | test_ipv4_routelist_coverage: test_ipv4_routelist | |
afb19109 | 151 | ./test_ipv4_routelist -1 | grep Hit | awk '{print $$2}' | sort | uniq |
78403150 A |
152 | |
153 | # ---------- | |
154 | ||
155 | test_ipv6_routelist.o: ip_plugin.c | |
afb19109 | 156 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_IPV6_ROUTELIST=1 ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o $@ $^ |
78403150 | 157 | |
8004eb02 | 158 | test_ipv6_routelist: test_ipv6_routelist.o IPMonitorControlPrefs.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o dns-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o libSystemConfiguration_client.o libSystemConfiguration_server.o |
c956c85e | 159 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o test_ipv6_routelist $^ ${EXTRA_CFLAGS} -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework Foundation -framework Network -framework NetworkExtension -framework CoreServices |
78403150 A |
160 | |
161 | test_ipv6_routelist_reference.txt: test_ipv6_routelist | |
afb19109 | 162 | sh $(REFERENCE_OUTPUT) create ./test_ipv6_routelist test_ipv6_routelist_reference.txt routelist_output_filter.sh |
78403150 A |
163 | |
164 | test_ipv6_routelist_test: test_ipv6_routelist | |
afb19109 | 165 | sh $(REFERENCE_OUTPUT) test ./test_ipv6_routelist test_ipv6_routelist_reference.txt routelist_output_filter.sh |
78403150 A |
166 | |
167 | test_ipv6_routelist_coverage: test_ipv6_routelist | |
afb19109 | 168 | ./test_ipv6_routelist -1 | grep Hit | awk '{print $$2}' | sort | uniq |
a40a14f8 | 169 | |
6bb65964 A |
170 | # ---------- |
171 | ||
172 | IPMonitor.o: ip_plugin.c | |
9de8ab86 | 173 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -DTEST_IPMONITOR ${TEST_INCLUDE} ${EXTRA_CFLAGS} -Wall -O0 -g -c -o IPMonitor.o ip_plugin.c |
6bb65964 | 174 | |
942cecd7 | 175 | IPMonitor: IPMonitor.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o network_state_information_priv.o network_information_server.o dns-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o IPMonitorControlServer.o libSystemConfiguration_client.o libSystemConfiguration_server.o |
f715d946 | 176 | $(CC) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -Wall -O0 -g -o IPMonitor IPMonitor.o IPMonitorControlPrefs.o agent-monitor.o configAgent.o controller.o dnsAgent.o proxyAgent.o dnsinfo_create.o dnsinfo_flatfile.o dnsinfo_server.o network_state_information_priv.o network_information_server.o dns-configuration.o proxy-configuration.o set-hostname.o smb-configuration.o IPMonitorControlServer.o libSystemConfiguration_client.o libSystemConfiguration_server.o ${EXTRA_CFLAGS} -lnetwork -framework SystemConfiguration -framework CoreFoundation -framework Foundation -framework Network -framework NetworkExtension |
6bb65964 A |
177 | |
178 | # ---------- | |
a40a14f8 | 179 | |
afb19109 A |
180 | nat64: nat64-configuration.c |
181 | $(CC) -DTEST_NAT64_CONFIGURATION $(TEST_INCLUDE) $(PF_INC) $(ARCH_FLAGS) -isysroot $(SYSROOT) -lnetwork -framework CoreFoundation -framework SystemConfiguration -Wall -O0 -g -o $@ $^ | |
182 | ||
183 | # ---------- | |
184 | ||
a40a14f8 | 185 | clean: |
8004eb02 | 186 | rm -rf *.dSYM *.o test_dns test_hostname test_proxy test_smb test_ipv4_routelist test_ipv6_routelist test_dns_order IPMonitor nat64 |