1
2# This Makefile builds a shared version of the library,
3# libbz2.so.1.0.6, with soname libbz2.so.1.0,
4# at least on x86-Linux (RedHat 7.2),
5# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
6# Please see the README file for some important info
7# about building the library like this.
8
9# ------------------------------------------------------------------
10# This file is part of bzip2/libbzip2, a program and library for
11# lossless, block-sorting data compression.
12#
13# bzip2/libbzip2 version 1.0.6 of 6 September 2010
14# Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
15#
16# Please read the WARNING, DISCLAIMER and PATENTS sections in the
17# README file.
18#
19# This program is released under the terms of the license contained
20# in the file LICENSE.
21# ------------------------------------------------------------------
22
23
24SHELL=/bin/sh
25CC=gcc
26BIGFILES=-D_FILE_OFFSET_BITS=64
27CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
28
29OBJS= blocksort.o  \
30      huffman.o    \
31      crctable.o   \
32      randtable.o  \
33      compress.o   \
34      decompress.o \
35      bzlib.o
36
37all: $(OBJS)
38	$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
39	$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
40	rm -f libbz2.so.1.0
41	ln -s libbz2.so.1.0.6 libbz2.so.1.0
42
43clean:
44	rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
45
46blocksort.o: blocksort.c
47	$(CC) $(CFLAGS) -c blocksort.c
48huffman.o: huffman.c
49	$(CC) $(CFLAGS) -c huffman.c
50crctable.o: crctable.c
51	$(CC) $(CFLAGS) -c crctable.c
52randtable.o: randtable.c
53	$(CC) $(CFLAGS) -c randtable.c
54compress.o: compress.c
55	$(CC) $(CFLAGS) -c compress.c
56decompress.o: decompress.c
57	$(CC) $(CFLAGS) -c decompress.c
58bzlib.o: bzlib.c
59	$(CC) $(CFLAGS) -c bzlib.c
60