summaryrefslogtreecommitdiff
path: root/libexec/ld.so/test/Makefile
blob: fdf5114fcc617b0a5a17a482a484a599df31293d (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
49
#	$OpenBSD: Makefile,v 1.3 2000/10/13 05:15:17 drahn Exp $

DIR=/usr/src/libexec/ld.so/obj/ld.so
.if (${MACHINE_ARCH} == "powerpc")
#necssary to build the shared objects. not necessary for dltest but
#doesn't hurt
CFLAGS += -fpic
.endif
CFLAGS += -g
LDFLAGS += -Wl,--export-dynamic -Wl,-dynamic-linker -Wl,${DIR}
#LDFLAGS += -Wl,--export-dynamic 

SRCS=	ldt.c
PROG=	ldt
MAN=
CLEANFILES= dltest dltest.o libfoo.so libfoo.o libbar.so libbar.o libdep.so
CLEANFILES+= libdep.o CCtest dltest A.o B.o tst.o libA.so libB.so

all:	dltest CCtest

dltest: dltest.o libfoo.so libbar.so libdep.so
	$(CC) ${CFLAGS} -o $@ dltest.o ${LDFLAGS} -ldl

libfoo.so: libfoo.o
	$(CC) -shared -o libfoo.so libfoo.o

libbar.so: libbar.o 
	$(CC) -shared -o libbar.so libbar.o 

libdep.so: libdep.o
	$(CC) -shared -o libdep.so libdep.o

A.o:	A.C
	g++ -c ${CFLAGS} ${.IMPSRC}

libA.so:	A.o
	$(CC) -shared -o $@ A.o 

B.o:	B.C
	g++ -c ${CFLAGS} ${.IMPSRC}

libB.so:	B.o
	$(CC) -shared -o $@ B.o 

CCtest:	libA.so libB.so tst.o
	g++ ${LDFLAGS} -o $@ tst.o -L . -lB -lA

.include <bsd.prog.mk>
.include <bsd.subdir.mk>