]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/restrict-environ/Makefile
dyld-195.5.tar.gz
[apple/dyld.git] / unit-tests / test-cases / restrict-environ / Makefile
index a383d1a7aec1a3224f9a4aecb6ba10196adea891..8aa6bea413796277bf79a76cefeeea50061c6015 100644 (file)
 TESTROOT = ../..
 include ${TESTROOT}/include/common.makefile
 
 TESTROOT = ../..
 include ${TESTROOT}/include/common.makefile
 
+ifeq "$(OS_NAME)" "iPhoneOS"
+       RUN_AS_USER = login -f -l mobile
+else
+       RUN_AS_USER = 
+endif
+
+PWD = `pwd`
+
 all-check: all check
 
 check:
 all-check: all check
 
 check:
-       export DYLD_LIBRARY_PATH=/ && export DYLD_PRINT_LIBRARIES=/ &&  export DYLD_PREBIND_DEBUG=/ && ./main
+       ${RUN_AS_USER} $(PWD)/main-with-env
 
 all: main
 
 main: main.c
        ${CC} ${CCFLAGS} -w -I${TESTROOT}/include -o main main.c -sectcreate __RESTRICT __restrict /dev/null
 
 all: main
 
 main: main.c
        ${CC} ${CCFLAGS} -w -I${TESTROOT}/include -o main main.c -sectcreate __RESTRICT __restrict /dev/null
+       echo "#!/bin/sh" > main-with-env
+       echo "export DYLD_INSERT_LIBRARIES=/" >> main-with-env
+       echo "export DYLD_PRINT_LIBRARIES=/" >> main-with-env
+       echo "$(PWD)/main" >> main-with-env
+       chmod +x main-with-env
 
 clean:
 
 clean:
-       ${RM} ${RMFLAGS} *~ main
+       ${RM} ${RMFLAGS} *~ main main-with-env