Home | History | Annotate | Download | only in bzip2
      1 #
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the "License").
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets "[]" replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 #ident	"@(#)makefile.build	1.4	07/04/02 SMI"
     26 #
     27 
     28 include $(SRC)/cmd/Makefile.cmd
     29 
     30 CFLAGS += -KPIC -D_FILE_OFFSET_BITS=64
     31 
     32 OBJS= blocksort.o  \
     33       huffman.o    \
     34       crctable.o   \
     35       randtable.o  \
     36       compress.o   \
     37       decompress.o \
     38       bzlib.o	\
     39       oldapi.o
     40 
     41 all: libbz2.so .WAIT bzip2 bzip2recover
     42 
     43 bzip2: libbz2.so bzip2.o
     44 	$(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
     45 
     46 bzip2recover: bzip2recover.o
     47 	$(CC) $(CFLAGS) -o bzip2recover bzip2recover.o
     48 
     49 libbz2.so: $(OBJS)
     50 	rm -f libbz2.so libbz2.so.1
     51 	$(CC) $(CFLAGS) $(XREGSFLAG) -G -h libbz2.so.1 -o libbz2.so.1 \
     52 		-z defs -z text -zcombreloc $(OBJS) -M ../mapfile -L. \
     53 		-L$(ROOT)/usr/lib -lc
     54 	ln -s libbz2.so.1 libbz2.so
     55 
     56 test: bzip2
     57 	@cat words1
     58 	env LD_LIBRARY_PATH=`pwd` ./bzip2 -1  < sample1.ref > sample1.rb2
     59 	env LD_LIBRARY_PATH=`pwd` ./bzip2 -2  < sample2.ref > sample2.rb2
     60 	env LD_LIBRARY_PATH=`pwd` ./bzip2 -3  < sample3.ref > sample3.rb2
     61 	env LD_LIBRARY_PATH=`pwd` ./bzip2 -d  < sample1.bz2 > sample1.tst
     62 	env LD_LIBRARY_PATH=`pwd` ./bzip2 -d  < sample2.bz2 > sample2.tst
     63 	env LD_LIBRARY_PATH=`pwd` ./bzip2 -ds < sample3.bz2 > sample3.tst
     64 	cmp sample1.bz2 sample1.rb2 
     65 	cmp sample2.bz2 sample2.rb2
     66 	cmp sample3.bz2 sample3.rb2
     67 	cmp sample1.tst sample1.ref
     68 	cmp sample2.tst sample2.ref
     69 	cmp sample3.tst sample3.ref
     70 	@cat words3
     71 
     72 blocksort.o: blocksort.c
     73 	@cat words0
     74 	$(CC) $(CFLAGS) -c blocksort.c
     75