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 2009 Sun Microsystems, Inc. All rights reserved. 23 # Use is subject to license terms. 24 # 25 #ident "@(#)Makefile.sfw 1.15 09/02/02 SMI" 26 27 # This makefile is unusual, because it builds both 32 and 64 bit 28 # versions of the library. The builds occur in separate subdirs, 29 # and 2 install scripts are used. 30 31 VER=bzip2-1.0.5 32 VER64=$(VER)-64 33 34 # lint stuff 35 LIBNAME= bz2 36 LINTOUT= lint.out 37 38 all: real-all 39 40 include ../Makefile.cmd 41 42 LINTFLAGS= -nsvx -I. $(CCBITS32) 43 LINTFLAGS64= -nsvx -I. $(CCBITS64) 44 45 # each all target has 2 parts. The first builds the commands, and 46 # the second builds the shared library. 47 48 all32: $(VER)/Makefile 49 (cd $(VER); env \ 50 LD_OPTIONS="-M $(SRC)/cmd/mapfile_noexstk" \ 51 PATH=$(SFW_PATH) \ 52 "MAKE=$(CCSMAKE)" \ 53 $(CCSMAKE)) 54 55 all64: $(VER64)/Makefile 56 (cd $(VER64); env \ 57 PATH=$(SFW_PATH) \ 58 "MAKE=$(CCSMAKE)" \ 59 $(CCSMAKE)) 60 61 install: all 62 $(SH) ./install-bzip2 63 MACH64=$(MACH64) $(SH) ./install-bzip2-64 64 65 real-all: all32 lint32 all64 lint64 66 67 test: test32 test64 68 69 test32: all32 70 (cd $(VER); env \ 71 PATH=$(SFW_PATH) \ 72 "MAKE=$(CCSMAKE)" \ 73 $(CCSMAKE) test) 74 75 test64: all64 76 (cd $(VER64); env \ 77 PATH=$(SFW_PATH) \ 78 "MAKE=$(CCSMAKE)" \ 79 $(CCSMAKE) test) 80 81 # more hackiness - if building 64 bit objects, clone the source 82 # directory after extracting it. 83 84 $(VER)/Makefile: $(VER).tar.gz 85 gzip -dc $(VER).tar.gz | tar xopf - 86 gpatch -p0 < bzip2.patch 87 cp $(VER)/Makefile $(VER)/Makefile.dist 88 cp oldapi.c $(VER)/oldapi.c 89 cp makefile.build.64 $(VER)/Makefile 90 mv $(VER) $(VER64) 91 touch $(VER64)/Makefile 92 gzip -dc $(VER).tar.gz | tar xopf - 93 gpatch -p0 < bzip2.patch 94 cp $(VER)/Makefile $(VER)/Makefile.dist 95 cp oldapi.c $(VER)/oldapi.c 96 cp makefile.build $(VER)/Makefile 97 touch $(VER)/Makefile 98 99 clean: 100 -rm -rf $(VER) 101 -rm -rf $(VER64) 102 103 lint32: $(VER)/Makefile 104 (cd $(VER); \ 105 $(LINT.c) -o $(LIBNAME) ../llib-lbz2 > $(LINTOUT) 2>&1) 106 107 lint64: $(VER64)/Makefile 108 (cd $(VER64); \ 109 $(LINT64.c) -o $(LIBNAME) ../llib-lbz2 > $(LINTOUT) 2>&1) 110 111 install_h: 112 113 include ../Makefile.targ 114