blob: ee45c4a6ff36b03c49a4417c894b0a95a73cafba (
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
|
$NetBSD: patch-aa,v 1.5 2002/03/24 14:02:36 mjl Exp $
--- Makefile.orig Sat Jan 26 00:34:53 2002
+++ Makefile Sun Mar 24 14:56:33 2002
@@ -2,18 +2,15 @@
SHELL=/bin/sh
# To assist in cross-compiling
-CC=gcc
+CC=${LIBTOOL} ${REALCC}
+LD=${LIBTOOL} ${REALCC}
AR=ar
RANLIB=ranlib
-LDFLAGS=
+LDFLAGS+=
# Suitably paranoid flags to avoid bugs in gcc-2.7
BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
-
-# Where you want it installed when you do 'make install'
-PREFIX=/usr
-
+CFLAGS+=-Wall -Winline -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
OBJS= blocksort.o \
huffman.o \
@@ -23,22 +20,18 @@
decompress.o \
bzlib.o
-all: libbz2.a bzip2 bzip2recover test
+all: libbz2.la bzip2 bzip2recover test
-bzip2: libbz2.a bzip2.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+bzip2: libbz2.la bzip2.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -static -o bzip2 bzip2.o libbz2.la
bzip2recover: bzip2recover.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -static -o bzip2recover bzip2recover.o
-libbz2.a: $(OBJS)
- rm -f libbz2.a
- $(AR) cq libbz2.a $(OBJS)
- @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
- -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
- echo $(RANLIB) libbz2.a ; \
- $(RANLIB) libbz2.a ; \
- fi
+libbz2.la: $(OBJS)
+ rm -f libbz2.la
+ $(LD) $(LDFLAGS) -o libbz2.la $(OBJS:.o=.lo) -version-info 0:0 \
+ -rpath $(PREFIX)/lib
check: test
test: bzip2
|