##
-# Copyright (c) 2007 Apple Inc. All rights reserved.
+# Copyright (c) 2007-2010 Apple Inc. All rights reserved.
#
# @APPLE_LICENSE_HEADER_START@
#
TESTROOT = ../..
include ${TESTROOT}/include/common.makefile
+SHELL = bash # use bash shell so we can redirect just stderr
+
+
#
# verify that apple[0] parameter is correct by comparing to argv[1]
#
-run: all
- ./main-10.4 ./main-10.4
- ./main-10.5 ./main-10.5
- ./main-10.4.stripped ./main-10.4.stripped
- ./main-10.5.stripped ./main-10.5.stripped
- `pwd`/main-10.4 `pwd`/main-10.4
- `pwd`/main-10.5 `pwd`/main-10.5
- `pwd`/main-10.4.stripped `pwd`/main-10.4.stripped
- `pwd`/main-10.5.stripped `pwd`/main-10.5.stripped
+all-check: all check
+
+check:
+ ./main ./main
+ ./main.stripped ./main.stripped
+ `pwd`/main `pwd`/main
+ `pwd`/main.stripped `pwd`/main.stripped
+ export DYLD_LIBRARY_PATH=. && export DYLD_FRAMEWORK_PATH=. && ./main-setuid ./main-setuid 2>/dev/null
+
+all: main main.stripped main-setuid
-all: main-10.4 main-10.5 main-10.4.stripped main-10.5.stripped
+main: main.c
+ ${CC} ${CCFLAGS} -I${TESTROOT}/include -o main main.c -w
-main-10.4: main.c
- ${CC} ${CCFLAGS} -I${TESTROOT}/include -o main-10.4 main.c -mmacosx-version-min=10.4 -w
+main.stripped: main
+ strip main -o main.stripped
-main-10.4.stripped: main-10.4
- strip main-10.4 -o main-10.4.stripped
-
-main-10.5: main.c
- ${CC} ${CCFLAGS} -I${TESTROOT}/include -o main-10.5 main.c -mmacosx-version-min=10.5 -w
+main-setuid: main
+ cp main main-setuid
+ sudo chown root main-setuid
+ sudo chmod 4755 main-setuid
-main-10.5.stripped: main-10.5
- strip main-10.5 -o main-10.5.stripped
clean:
- ${RM} ${RMFLAGS} *~ main-10.4 main-10.5 main-10.4.stripped main-10.5.stripped
+ ${RM} ${RMFLAGS} *~ main main.stripped main-setuid