File: Makefile

package info (click to toggle)
lintian 1.23.28%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 2,044 kB
  • ctags: 295
  • sloc: perl: 5,038; makefile: 702; python: 431; sh: 329; ansic: 30; tcl: 4; sed: 1
file content (44 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (3)
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
# This is the correct way to build a lib

CC=gcc
CFLAGS=-Wall -Winline -O2

OBJS=baz.o extra.o

all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b

libbaz2.so: libbaz2.so.1.0
	ln -sf $^ $@
libbaz2.so.1.0: libbaz2.so.1.0.3b
	ln -sf $^ $@

# Oops, forget the soname altogether
libbaz1.so.1.0.3b: $(OBJS)
	$(CC) -o $@ -shared $^ -lc

libbaz2.so.1.0.3b: $(OBJS:%.o=%.sho)
	$(CC) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc

# Non-PIC.
libbaz3.so.1.0.3b: $(OBJS)
	$(CC) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc

#%.o-noreentrant: %.c
#	$(CC) $(CFLAGS) -o $@ -c $<

%.sho: %.c
	$(CC) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $<

%.o: %.c
	$(CC) $(CFLAGS) -D_REENTRANT -o $@ -c $<

libbaz2.a: $(OBJS)
	ar cq $@ $(OBJS)
	ranlib $@

# The pic one in the .a (wrong), no archive table
libbaz1.a: $(OBJS:%.o=%.sho)
	ar cqS $@ $^

clean:
	rm -f *.a *.o *.so* *.sho