X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/577cc7d16e9038f578beeee9ada9fd8f82f0b3d6..bac542e65c0030c0d819c7ff1dcfc25892a61844:/unit-tests/test-cases/insert-libraries-with-initializer/Makefile diff --git a/unit-tests/test-cases/insert-libraries-with-initializer/Makefile b/unit-tests/test-cases/insert-libraries-with-initializer/Makefile index 352ec10..f4ae30a 100644 --- a/unit-tests/test-cases/insert-libraries-with-initializer/Makefile +++ b/unit-tests/test-cases/insert-libraries-with-initializer/Makefile @@ -23,13 +23,35 @@ TESTROOT = ../.. include ${TESTROOT}/include/common.makefile +# +# verifies that initializers for inserted libraries run before the +# main executables initializers +# + + run: all - export DYLD_INSERT_LIBRARIES="libfoo.dylib" && ./main + export DYLD_INSERT_LIBRARIES=libinsert.dylib && ./main -all: - ${CC} ${CCFLAGS} -I${TESTROOT}/include -dynamiclib -o libfoo.dylib foo.c - ${CC} ${CCFLAGS} -I${TESTROOT}/include -o main main.c +all: main libinsert.dylib + + +main: main.c libfoo1.dylib libbase.dylib + ${CC} ${CCFLAGS} -I${TESTROOT}/include -o main main.c libfoo1.dylib libbase.dylib -clean: - ${RM} ${RMFLAGS} *~ main libfoo.dylib +libfoo1.dylib: foo1.c libbase.dylib libfoo2.dylib + ${CC} ${CCFLAGS} -I${TESTROOT}/include -dynamiclib -o libfoo1.dylib foo1.c libbase.dylib libfoo2.dylib + +libfoo2.dylib: foo2.c libbase.dylib + ${CC} ${CCFLAGS} -I${TESTROOT}/include -dynamiclib -o libfoo2.dylib foo2.c libbase.dylib + +libinsert.dylib: insert.c libbase.dylib + ${CC} ${CCFLAGS} -I${TESTROOT}/include -dynamiclib -o libinsert.dylib insert.c libbase.dylib + +libbase.dylib: base.c + ${CC} ${CCFLAGS} -I${TESTROOT}/include -dynamiclib -o libbase.dylib base.c + + +clean: + ${RM} ${RMFLAGS} *~ main lib*.dylib +