# $Id$ # This Makefile builds a shared version of the library, # libbz2.so.1.0.6, with soname libbz2.so.1.0, # at least on x86-Linux (RedHat 7.2), # with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98). # Please see the README file for some important info # about building the library like this. # ------------------------------------------------------------------ # This file is part of bzip2/libbzip2, a program and library for # lossless, block-sorting data compression. # # bzip2/libbzip2 version 1.0.6 of 6 September 2010 # Copyright (C) 1996-2010 Julian Seward # # 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. # ------------------------------------------------------------------ srcdir=../src SHELL=/bin/sh CC=$(arch)-gcc CFLAGS=-Wall -Winline -O2 -DWIN32 MAINCFLAGS=$(CFLAGS) -DBZ_IMPORT INCLUDEDIR=$(DESTDIR)/usr/$(arch)/include LIBDIR=$(DESTDIR)/usr/$(arch)/lib BINDIR=$(DESTDIR)/usr/$(arch)/bin VERSION=$(shell sed -e 's/^\#define BZ_VERSION *"\([0-9].[0-9].[0-9]\),.*"/\1/p;d' $(srcdir)/bzlib_private.h) OBJS= blocksort.o \ huffman.o \ crctable.o \ randtable.o \ compress.o \ decompress.o \ bzlib.o all: libbz2-1.dll libbz2.dll.a bzip2.exe bzip2recover.exe install: all mkdir -p $(INCLUDEDIR) mkdir -p $(LIBDIR)/pkgconfig mkdir -p $(BINDIR) install -m 755 libbz2-1.dll $(BINDIR) install -m 644 libbz2.dll.a $(LIBDIR) install -m 755 bzip2.exe $(BINDIR) install -m 755 bzip2recover.exe $(BINDIR) install -m 644 $(srcdir)/bzlib.h $(INCLUDEDIR) sed -e 's/__VERSION__/$(VERSION)/g' -e 's/__arch__/$(arch)/g' < $(srcdir)/../pc/libbz2.pc > $(LIBDIR)/pkgconfig/libbz2.pc libbz2-1.dll libbz2.dll.a: $(OBJS) $(CC) -shared -Wl,--out-implib,libbz2.dll.a -o libbz2-1.dll $(srcdir)/libbz2.def $(OBJS) bzip2.exe: libbz2.dll.a bzip2.o $(CC) $(MAINCFLAGS) $(LDFLAGS) -o bzip2.exe bzip2.o -L. -lbz2 bzip2recover.exe: bzip2recover.o $(CC) $(MAINCFLAGS) $(LDFLAGS) -o bzip2recover.exe bzip2recover.o clean: rm -f $(OBJS) bzip2.o bzip2recover.o libbz2-1.dll libbz2.dll.a bzip2.exe bzip2recover.exe blocksort.o: $(srcdir)/blocksort.c $(CC) $(CFLAGS) -c $< -o $@ huffman.o: $(srcdir)/huffman.c $(CC) $(CFLAGS) -c $< -o $@ crctable.o: $(srcdir)/crctable.c $(CC) $(CFLAGS) -c $< -o $@ randtable.o: $(srcdir)/randtable.c $(CC) $(CFLAGS) -c $< -o $@ compress.o: $(srcdir)/compress.c $(CC) $(CFLAGS) -c $< -o $@ decompress.o: $(srcdir)/decompress.c $(CC) $(CFLAGS) -c $< -o $@ bzlib.o: $(srcdir)/bzlib.c $(CC) $(CFLAGS) -c $< -o $@ bzip2.o: $(srcdir)/bzip2.c $(CC) $(MAINCFLAGS) -c $< -o $@ bzip2recover.o: $(srcdir)/bzip2recover.c $(CC) $(MAINCFLAGS) -c $< -o $@