1 ARCHS = -arch i386 -arch x86_64
2 CFLAGS = -Wall -pipe -O0 -gdwarf-2
4 REACH_SERVER_C = ../../SystemConfiguration.fproj/reachability/SCNetworkReachabilityServer_server.c
6 REACH_SERVER_PLIST = /Library/LaunchDaemons/com.apple.SCNetworkReachability.plist
7 SYMROOT = ${shell basename ${shell dirname ${shell dirname ${PWD}}}}
9 all: /var/tmp/reach_server ${REACH_SERVER_PLIST}
11 ${REACH_SERVER_PLIST}: Makefile
12 @sudo mkdir -p ${shell dirname ${REACH_SERVER_PLIST}}
13 @sudo launchctl unload -w ${REACH_SERVER_PLIST} > /dev/null 2>&1 || /usr/bin/true
14 @sudo rm -f ${REACH_SERVER_PLIST}
15 @sudo defaults write ${REACH_SERVER_PLIST} Label \
16 SCNetworkReachability-DEBUG
17 @sudo defaults write ${REACH_SERVER_PLIST} MachServices \
19 SCNetworkReachability-DEBUG \
21 @sudo defaults write ${REACH_SERVER_PLIST} Program \
23 @sudo defaults write ${REACH_SERVER_PLIST} ProgramArguments \
25 SCNetworkReachability-DEBUG \
27 @sudo defaults write ${REACH_SERVER_PLIST} EnvironmentVariables \
30 ${BUILDIT_DIR}/${SYMROOT}.roots/${SYMROOT}~sym \
32 SCNetworkReachability-DEBUG
33 @sudo defaults write ${REACH_SERVER_PLIST} ThrottleInterval \
35 @sudo chown root:wheel ${REACH_SERVER_PLIST}
36 @sudo chmod 644 ${REACH_SERVER_PLIST}
37 sudo launchctl load -w ${REACH_SERVER_PLIST}
39 reach_server.o: ${REACH_SERVER_C}
40 cc ${ARCHS} ${CFLAGS} -DMAIN -I ../../SystemConfiguration.fproj -F ${BUILDIT_DIR}/${SYMROOT}.roots/${SYMROOT}~sym -c -o reach_server.o ${REACH_SERVER_C}
42 reach_server: reach_server.o
43 cc ${ARCHS} -o reach_server reach_server.o -framework CoreFoundation -F ${BUILDIT_DIR}/${SYMROOT}.roots/${SYMROOT}~sym -framework SystemConfiguration
44 dsymutil reach_server -o reach_server.dSYM
46 /var/tmp/reach_server: reach_server
47 @sudo rm -f /var/tmp/reach_server
48 cp -p reach_server /var/tmp/reach_server
49 @sudo chown root:wheel /var/tmp/reach_server
50 @sudo chmod 755 /var/tmp/reach_server
53 sudo launchctl unload -w ${REACH_SERVER_PLIST} > /dev/null 2>&1 || /usr/bin/true
54 @sudo rm -f ${REACH_SERVER_PLIST}
55 @sudo rm -rf /var/tmp/reach_server
56 rm -rf *.o reach_server reach_server.dSYM