summaryrefslogtreecommitdiff
blob: cd0ee20a5ebab1dccef7904127c39f36ba5cb9c6 (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
# This Makefile builds a shared version of the library, 
# libbz2.1.0.5.dylib, with install_name libbz2.1.dylib on Darwin
#
# Makefile created and used by Gentoo

# ------------------------------------------------------------------
# This file is part of bzip2/libbzip2, a program and library for
# lossless, block-sorting data compression.
#
# bzip2/libbzip2 version 1.0.5 of 10 December 2007
# Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
#
# Please read the WARNING, DISCLAIMER and PATENTS sections in the 
# README file.
#
# This program is released under the terms of the license contained
# in the file LICENSE.
# ------------------------------------------------------------------


SHELL=/bin/sh
CC=gcc
BIGFILES=-D_FILE_OFFSET_BITS=64
CFLAGS+=-fpic -fPIC -Wall -Winline $(BIGFILES)
PREFIX=/usr
LIBDIR=lib
SOLDFLAGS=-dynamiclib -install_name $(PREFIX)/$(LIBDIR)/libbz2.1.dylib -compatibility_version 1.0.0 -current_version 1.0.5

OBJS= blocksort.o  \
      huffman.o    \
      crctable.o   \
      randtable.o  \
      compress.o   \
      decompress.o \
      bzlib.o

all: $(OBJS)
	$(CC) $(LDFLAGS) $(SOLDFLAGS) -o libbz2.1.0.5.dylib $(OBJS)
	$(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.1.0.5.dylib
	rm -f libbz2.1.0.dylib
	ln -s libbz2.1.0.5.dylib libbz2.1.0.dylib

clean: 
	rm -f $(OBJS) bzip2.o libbz2.1.0.5.dylib libbz2.1.0.dylib bzip2-shared

blocksort.o: blocksort.c
	$(CC) $(CFLAGS) -c blocksort.c
huffman.o: huffman.c
	$(CC) $(CFLAGS) -c huffman.c
crctable.o: crctable.c
	$(CC) $(CFLAGS) -c crctable.c
randtable.o: randtable.c
	$(CC) $(CFLAGS) -c randtable.c
compress.o: compress.c
	$(CC) $(CFLAGS) -c compress.c
decompress.o: decompress.c
	$(CC) $(CFLAGS) -c decompress.c
bzlib.o: bzlib.c
	$(CC) $(CFLAGS) -c bzlib.c