]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/insert-libraries-with-initializer/Makefile
dyld-360.14.tar.gz
[apple/dyld.git] / unit-tests / test-cases / insert-libraries-with-initializer / Makefile
index 352ec10dd2f532321ae0dbff0e1a3755d4608ff3..fc9269f7dc1050db953b4a2b334ba308f345cb40 100644 (file)
 TESTROOT = ../..
 include ${TESTROOT}/include/common.makefile
 
-run: all
-       export DYLD_INSERT_LIBRARIES="libfoo.dylib" && ./main
+#
+# verifies that initializers for inserted libraries run before the
+# main executables initializers
+#
 
-all:
-       ${CC} ${CCFLAGS} -I${TESTROOT}/include -dynamiclib -o libfoo.dylib foo.c
-       ${CC} ${CCFLAGS} -I${TESTROOT}/include -o main main.c
 
-clean:
-       ${RM} ${RMFLAGS} *~ main libfoo.dylib
+all-check: all check
+
+check:
+       export DYLD_INSERT_LIBRARIES=libinsert.dylib && ./main
+
+all: main libinsert.dylib
+
+
+main: main.c libfoo1.dylib libbase.dylib
+       ${CC} ${CCFLAGS} -I${TESTROOT}/include -o main main.c  libfoo1.dylib  libbase.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
+