3cd025e9d8
PR: ports/83694 Submitted by: Vsevolod Stakhov <vsevolod@highsecure.ru> Approved by: Jason Harris <jharris@widomaker.com> (maintainer)
80 lines
2.1 KiB
Text
80 lines
2.1 KiB
Text
--- Makefile.orig Thu Feb 17 14:28:24 2005
|
|
+++ Makefile Tue Jul 19 02:39:56 2005
|
|
@@ -2,13 +2,15 @@
|
|
SHELL=/bin/sh
|
|
|
|
# To assist in cross-compiling
|
|
-CC=gcc
|
|
+CC?=gcc
|
|
AR=ar
|
|
RANLIB=ranlib
|
|
LDFLAGS=
|
|
|
|
BIGFILES=-D_FILE_OFFSET_BITS=64
|
|
-CFLAGS=-Wall -Winline -O -g $(BIGFILES)
|
|
+CFLAGS?=-O2
|
|
+CFLAGS+=-Wall -Winline -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
|
|
+SOFLAGS=-fPIC -fpic -DPIC
|
|
|
|
# Where you want it installed when you do 'make install'
|
|
PREFIX=/usr
|
|
@@ -22,10 +24,18 @@
|
|
decompress.o \
|
|
bzlib.o
|
|
|
|
-all: libbz2.a bzip2 bzip2recover test
|
|
+SO_OBJS= blocksort.so \
|
|
+ huffman.so \
|
|
+ crctable.so \
|
|
+ randtable.so \
|
|
+ compress.so \
|
|
+ decompress.so \
|
|
+ bzlib.so
|
|
|
|
-bzip2: libbz2.a bzip2.o
|
|
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
|
|
+all: libbz2.so.1 libbz2.a bzip2 bzip2recover test
|
|
+
|
|
+bzip2: libbz2.so.1 libbz2.a bzip2.o
|
|
+ $(CC) $(CFLAGS) -o bzip2 bzip2.o libbz2.a
|
|
|
|
bzip2recover: bzip2recover.o
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
|
|
@@ -39,6 +49,10 @@
|
|
$(RANLIB) libbz2.a ; \
|
|
fi
|
|
|
|
+libbz2.so.1: $(SO_OBJS)
|
|
+ $(CC) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1 $(SO_OBJS)
|
|
+ ln -sf libbz2.so.1 libbz2.so
|
|
+
|
|
check: test
|
|
test: bzip2
|
|
@cat words1
|
|
@@ -96,9 +110,25 @@
|
|
echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
|
|
|
|
clean:
|
|
- rm -f *.o libbz2.a bzip2 bzip2recover \
|
|
+ rm -f *.o *.so libbz2.a libbz2.so.1 bzip2 bzip2recover \
|
|
sample1.rb2 sample2.rb2 sample3.rb2 \
|
|
sample1.tst sample2.tst sample3.tst
|
|
+
|
|
+blocksort.so: blocksort.c
|
|
+ @cat words0
|
|
+ $(CC) $(CFLAGS) $(SOFLAGS) -c blocksort.c -o blocksort.so
|
|
+huffman.so: huffman.c
|
|
+ $(CC) $(CFLAGS) $(SOFLAGS) -c huffman.c -o huffman.so
|
|
+crctable.so: crctable.c
|
|
+ $(CC) $(CFLAGS) $(SOFLAGS) -c crctable.c -o crctable.so
|
|
+randtable.so: randtable.c
|
|
+ $(CC) $(CFLAGS) $(SOFLAGS) -c randtable.c -o randtable.so
|
|
+compress.so: compress.c
|
|
+ $(CC) $(CFLAGS) $(SOFLAGS) -c compress.c -o compress.so
|
|
+decompress.so: decompress.c
|
|
+ $(CC) $(CFLAGS) $(SOFLAGS) -c decompress.c -o decompress.so
|
|
+bzlib.so: bzlib.c
|
|
+ $(CC) $(CFLAGS) $(SOFLAGS) -c bzlib.c -o bzlib.so
|
|
|
|
blocksort.o: blocksort.c
|
|
@cat words0
|