summaryrefslogtreecommitdiff
path: root/regress/libexec
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-04-02 07:15:03 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-04-02 07:15:03 +0000
commitc4d881908a367d6f66e3ab057994eb72fd9908fb (patch)
tree605b89545817c61f85acf2849c56913d9355d7a3 /regress/libexec
parentccb5e8466c3842f47e002db3804b63ce502aa834 (diff)
Let this work on gcc < 4, which don't accept /dev/null as a valid input file.
Diffstat (limited to 'regress/libexec')
-rw-r--r--regress/libexec/ld.so/df_1_noopen/Makefile38
1 files changed, 28 insertions, 10 deletions
diff --git a/regress/libexec/ld.so/df_1_noopen/Makefile b/regress/libexec/ld.so/df_1_noopen/Makefile
index 56118324b93..b59bb852fde 100644
--- a/regress/libexec/ld.so/df_1_noopen/Makefile
+++ b/regress/libexec/ld.so/df_1_noopen/Makefile
@@ -1,19 +1,39 @@
-# $OpenBSD: Makefile,v 1.2 2013/01/23 19:46:09 miod Exp $
+# $OpenBSD: Makefile,v 1.3 2013/04/02 07:15:02 miod Exp $
+
+.include <bsd.own.mk>
REGRESS_TARGETS = test
+.include <bsd.regress.mk>
+
+.if ${COMPILER_VERSION} == "gcc4"
+EMPTYFILE= /dev/null
+LIB_DEPENDS=
+.else
+EMPTYFILE= emptyfile
+CLEANFILES+= ${EMPTYFILE}
+LIB_DEPENDS= ${EMPTYFILE}
+
+# gcc3 will error with "file not recognized: File truncated" if the input file
+# is not at least four bytes long!
+${EMPTYFILE}:
+ printf "\n\n\n\n" > $@
+.endif
+
+CLEANFILES+=lib1.so lib2.so lib3.so dlopen dlopen1 dlopen2 dlopen3
+
.PHONY: test
test: lib1.so lib2.so lib3.so dlopen dlopen1 dlopen2 dlopen3
- ./test.sh
+ ${.CURDIR}/test.sh
-lib1.so:
- cc -o lib1.so /dev/null -fPIC -shared -Wl,-znodlopen
+lib1.so: ${LIB_DEPENDS}
+ cc -o lib1.so ${EMPTYFILE} -fPIC -shared -Wl,-znodlopen
-lib2.so:
- cc -o lib2.so /dev/null -fPIC -shared -L. -l1
+lib2.so: ${LIB_DEPENDS}
+ cc -o lib2.so ${EMPTYFILE} -fPIC -shared -L. -l1
-lib3.so:
- cc -o lib3.so /dev/null -fPIC -shared -L. -l2
+lib3.so: ${LIB_DEPENDS}
+ cc -o lib3.so ${EMPTYFILE} -fPIC -shared -L. -l2
dlopen: dlopen.c
cc -o dlopen ${.CURDIR}/dlopen.c
@@ -26,5 +46,3 @@ dlopen2: dlopen.c
dlopen3: dlopen.c
cc -o dlopen3 ${.CURDIR}/dlopen.c -L. -l3
-
-.include <bsd.regress.mk>