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 2008 Sun Microsystems, Inc. All rights reserved. 23 # Use is subject to license terms. 24 # 25 #ident "@(#)Makefile.sfw 1.22 08/02/20 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=libxml2-2.6.31 32 VER64=$(VER)-64 33 34 LDFLAGS= -z defs -z text -z combreloc -lpthread 35 LARGEFILES= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 36 37 include ../Makefile.lib 38 39 all: real-all 40 41 all32: $(VER)/config.status 42 (cd $(VER); env "CFLAGS=$(CFLAGS) $(XREGSFLAG) $(LARGEFILES)" \ 43 "LD_OPTIONS=-M ../mapfile -M $(SRC)/cmd/mapfile_noexstk" \ 44 PATH=$(SFW_PATH) \ 45 "MAKE=$(CCSMAKE)" $(CCSMAKE) -e libxml2.la; \ 46 env "CFLAGS=$(CFLAGS) $(XREGSFLAG) $(LARGEFILES)" \ 47 "LD_OPTIONS=-M $(SRC)/cmd/mapfile_noexstk" \ 48 PATH=$(SFW_PATH) \ 49 "MAKE=$(CCSMAKE)" $(CCSMAKE) -e) 50 51 all64: $(VER64)/config.status 52 (cd $(VER64); env "CC=$(CC64)" \ 53 "CFLAGS=$(CFLAGS64) $(XREGSFLAG64) $(LARGEFILES)" \ 54 "LD_OPTIONS=-M ../mapfile -M $(SRC)/cmd/mapfile_noexstk" \ 55 PATH=$(SFW_PATH) \ 56 "MAKE=$(CCSMAKE)" $(CCSMAKE) -e libxml2.la; \ 57 env "CFLAGS=$(CFLAGS64) $(XREGSFLAG64) $(LARGEFILES)" \ 58 "LD_OPTIONS=-M $(SRC)/cmd/mapfile_noexstk" \ 59 PATH=$(SFW_PATH) \ 60 "MAKE=$(CCSMAKE)" $(CCSMAKE) -e) 61 62 # lint stuff 63 LIBRARY=libxml2.a 64 LINTOUT= lint.out 65 LINTFLAGS = -nsvx -I./include $(LARGEFILES) 66 LINTFLAGS64 = -nsvx -Xarch=$(MACH64:sparcv9=v9) -I./include $(LARGEFILES) 67 68 install: all 69 $(SH) ./install-libxml2 70 MACH64=$(MACH64) $(SH) ./install-libxml2-64 71 72 real-all: all32 lint32 all64 lint64 73 74 test: test32 test64 75 76 # Test suite don't work under normal make, have to use gmake 77 78 test32: all32 79 (cd $(VER); $(GMAKE) tests) 80 81 test64: all64 82 (cd $(VER64); $(GMAKE) tests) 83 84 $(VER)/config.status: $(VER)/configure 85 (cd $(VER); \ 86 env "CC=$(CC)" "CFLAGS=$(CFLAGS)" \ 87 "LDFLAGS=$(LDFLAGS)" \ 88 PATH=$(SFW_PATH) \ 89 "MAKE=$(CCSMAKE)" \ 90 ./configure --prefix=/usr --with-threads \ 91 --with-python=/usr/bin/python2.4) 92 patch -N $(VER)/libtool < libtool.patch 93 94 $(VER64)/config.status: $(VER64)/configure 95 (cd $(VER64); \ 96 env "CC=$(CC64)" "CFLAGS=$(CFLAGS64)" \ 97 "LDFLAGS=$(LDFLAGS)" \ 98 PATH=$(SFW_PATH) \ 99 "MAKE=$(CCSMAKE)" \ 100 ./configure --prefix=/usr --with-threads \ 101 --with-python=/usr/bin/$(MACH64)/python2.4) 102 patch -N $(VER64)/libtool < libtool.patch 103 104 $(VER)/configure: $(VER).tar.gz 105 mkdir -p tmp; gzip -dc $(VER).tar.gz | (cd tmp; tar xopf -) 106 mv tmp/$(VER) $(VER); rmdir tmp 107 (cd $(VER); gpatch -p 1 < ../libxml2-01-remove-static.patch) 108 (cd $(VER); gpatch -p 1 < ../filename2URI.patch) 109 (cd $(VER); gpatch -p 1 < ../no-docs-examples.patch) 110 touch $(VER)/configure 111 112 $(VER64)/configure: $(VER).tar.gz 113 mkdir -p tmp; gzip -dc $(VER).tar.gz | (cd tmp; tar xopf -) 114 mv tmp/$(VER) $(VER64); rmdir tmp 115 (cd $(VER64); gpatch -p 1 < ../libxml2-01-remove-static.patch) 116 (cd $(VER64); gpatch -p 1 < ../filename2URI.patch) 117 (cd $(VER64); gpatch -p 1 < ../no-docs-examples.patch) 118 touch $(VER64)/configure 119 120 clean: 121 -rm -rf $(VER) 122 -rm -rf $(VER64) 123 124 lint32: $(VER)/config.status 125 (cd $(VER); \ 126 $(LINT.c) -o $(LIBNAME) ../llib-lxml2 > $(LINTOUT) 2>&1) 127 128 lint64: $(VER64)/config.status 129 (cd $(VER64); \ 130 $(LINT64.c) -o $(LIBNAME) ../llib-lxml2 > $(LINTOUT) 2>&1) 131 132 133 install_h: 134 135 include ../Makefile.targ 136