blob: 485b8719be47729c788c544f37dcc8552aa6c624 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# $OpenBSD: Makefile,v 1.4 2013/08/06 19:11:53 miod Exp $
.include <bsd.own.mk>
REGRESS_TARGETS = test
.include <bsd.regress.mk>
.if ${COMPILER_VERSION} == "gcc3"
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" > $@
.else
EMPTYFILE= /dev/null
LIB_DEPENDS=
.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
${.CURDIR}/test.sh
lib1.so: ${LIB_DEPENDS}
cc -o lib1.so ${EMPTYFILE} -fPIC -shared -Wl,-znodlopen
lib2.so: ${LIB_DEPENDS}
cc -o lib2.so ${EMPTYFILE} -fPIC -shared -L. -l1
lib3.so: ${LIB_DEPENDS}
cc -o lib3.so ${EMPTYFILE} -fPIC -shared -L. -l2
dlopen: dlopen.c
cc -o dlopen ${.CURDIR}/dlopen.c
dlopen1: dlopen.c
cc -o dlopen1 ${.CURDIR}/dlopen.c -L. -l1
dlopen2: dlopen.c
cc -o dlopen2 ${.CURDIR}/dlopen.c -L. -l2
dlopen3: dlopen.c
cc -o dlopen3 ${.CURDIR}/dlopen.c -L. -l3
|