blob: 343185cbe86536b0dc970cc58f886155c96e6a61 (
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# Make file for so-thresh test
OBJDIR=.
SRCDIR=.
CFLAGS = +DA1.1 -g
# This is how to build this generator.
gen-so-thresh.o: ${SRCDIR}/gen-so-thresh.c
$(CC) $(CFLAGS) -o gen-so-thresh.o -c ${SRCDIR}/gen-so-thresh.c
gen-so-thresh: gen-so-thresh.o
$(CC) $(CFLAGS) -o gen-so-thresh gen-so-thresh.o
# This is how to run this generator.
# This target should be made before the 'all' target,
# to ensure that the shlib sources are all available.
require_shlibs: gen-so-thresh
if ! [ -a lib00-so-thresh.c ] ; then \
gen-so-thresh ; \
fi
if ! [ -a lib01-so-thresh.c ] ; then \
gen-so-thresh ; \
fi
if ! [ -a lib02-so-thresh.c ] ; then \
gen-so-thresh ; \
fi
# This is how to build all the shlibs.
# Be sure to first make the require_shlibs target!
lib00-so-thresh.o: lib00-so-thresh.c
$(CC) $(CFLAGS) +Z -o lib00-so-thresh.o -c lib00-so-thresh.c
lib00-so-thresh.sl: lib00-so-thresh.o
$(LD) $(LDFLAGS) -b -o lib00-so-thresh.sl lib00-so-thresh.o
lib01-so-thresh.o: lib01-so-thresh.c
$(CC) $(CFLAGS) +Z -o lib01-so-thresh.o -c lib01-so-thresh.c
lib01-so-thresh.sl: lib01-so-thresh.o
$(LD) $(LDFLAGS) -b -o lib01-so-thresh.sl lib01-so-thresh.o
lib02-so-thresh.o: lib02-so-thresh.c
$(CC) $(CFLAGS) +Z -o lib02-so-thresh.o -c lib02-so-thresh.c
lib02-so-thresh.sl: lib02-so-thresh.o
$(LD) $(LDFLAGS) -b -o lib02-so-thresh.sl lib02-so-thresh.o
# For convenience, here's names for all pieces of all shlibs.
SHLIB_SOURCES = \
lib00-so-thresh.c \
lib01-so-thresh.c \
lib02-so-thresh.c
SHLIB_OBJECTS = $(SHLIB_SOURCES:.c=.o)
SHLIBS = $(SHLIB_SOURCES:.c=.sl)
SHLIB_NAMES = $(SHLIB_SOURCES:.c=)
EXECUTABLES = $(SHLIBS) gen-so-thresh so-thresh
OBJECT_FILES = $(SHLIB_OBJECTS) gen-so-thresh.o so-thresh.o
shlib_objects: $(SHLIB_OBJECTS)
shlibs: $(SHLIBS)
# This is how to build the debuggable testcase that uses the shlibs.
so-thresh.o: so-thresh.c
$(CC) $(CFLAGS) -o so-thresh.o -c so-thresh.c
so-thresh: shlibs so-thresh.o
$(LD) $(LDFLAGS) -o so-thresh -lc -L${OBJDIR} -c so-thresh.linkopts /opt/langtools/lib/end.o /lib/crt0.o so-thresh.o
# Yeah, but you should first make the require_shlibs target!
all: so-thresh gen-so-thresh
# To remove everything built via this makefile...
clean:
rm -f lib0*-so-thresh.*
rm -f *.o gen-so-thresh so-thresh.linkopts so-thresh.c
rm -f so-thresh
|