1 # 2 # CDDL HEADER START 3 # 4 # The contents of this file are subject to the terms of the 5 # Common Development and Distribution License (the "License"). 6 # You may not use this file except in compliance with the License. 7 # 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 # or http://www.opensolaris.org/os/licensing. 10 # See the License for the specific language governing permissions 11 # and limitations under the License. 12 # 13 # When distributing Covered Code, include this CDDL HEADER in each 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 # If applicable, add the following below this CDDL HEADER, with the 16 # fields enclosed by brackets "[]" replaced with your own identifying 17 # information: Portions Copyright [yyyy] [name of copyright owner] 18 # 19 # CDDL HEADER END 20 # 21 # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 22 # Use is subject to license terms. 23 # 24 # ident "@(#)Makefile.sfw 1.1 08/03/29 SMI" 25 26 # Libmemcached 0.16 27 28 VER=libmemcached-0.16 29 VER64=libmemcached-0.16-64 30 31 include ../Makefile.lib 32 33 SFW_PATH="$(SPRO_VROOT)/bin:/usr/perl5/bin:$(PATH)" 34 35 CFLAGS += -mt -xtarget=generic -xstrconst 36 CFLAGS64 += -mt -xtarget=generic64 -xstrconst 37 LDFLAGS = -L$(ROOT)/usr/lib -lsocket -lnsl 38 LDFLAGS64 = -L${ROOT}/usr/lib/${MACH64} -lsocket -lnsl 39 40 all: all32 all64 41 42 all32: $(VER)/config.status 43 (cd $(VER); env \ 44 CC=$(CC) "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" \ 45 CXX=$(CCC) "CXXFLAGS=$(CCFLAGS)" \ 46 PATH=$(SFW_PATH) \ 47 MAKE=$(CCSMAKE) \ 48 $(CCSMAKE)) 49 50 all64: $(VER64)/config.status 51 (cd $(VER64); env \ 52 CC=$(CC64) "CFLAGS=$(CFLAGS64)" "LDFLAGS=$(LDFLAGS64)" \ 53 CXX=$(CCC64) "CXXFLAGS=$(CCFLAGS64)" \ 54 PATH=$(SFW_PATH) \ 55 MAKE=$(CCSMAKE) \ 56 $(CCSMAKE)) 57 58 install32: all32 59 (cd $(VER); env \ 60 INSTALL=/usr/ucb/install \ 61 DESTDIR=$(ROOT) \ 62 PATH=$(SFW_PATH) \ 63 MAKE=$(CCSMAKE) \ 64 $(CCSMAKE) install) 65 $(SH) ./install-sfw 66 67 install64: all64 68 (cd $(VER64)/lib; env \ 69 INSTALL=/usr/ucb/install \ 70 DESTDIR=$(ROOT) \ 71 PATH=$(SFW_PATH) \ 72 MAKE=$(CCSMAKE) \ 73 $(CCSMAKE) install) 74 MACH64=$(MACH64) $(SH) ./install-sfw-64 75 76 install: install32 install64 77 78 $(VER)/config.status: $(VER)/configure 79 (cd $(VER); env \ 80 CC=$(CC) "CFLAGS=$(CFLAGS)" \ 81 PATH=$(SFW_PATH) \ 82 MAKE=$(CCSMAKE) \ 83 ./configure --prefix=/usr \ 84 --bindir=/usr/bin \ 85 --libdir=/usr/lib \ 86 --includedir=/usr/include \ 87 --mandir=/usr/share/man) 88 89 $(VER64)/config.status: $(VER64)/configure 90 (cd $(VER64); env \ 91 CC=$(CC64) "CFLAGS=$(CFLAGS64)" \ 92 PATH=$(SFW_PATH) \ 93 MAKE=$(CCSMAKE) \ 94 ./configure --prefix=/usr \ 95 --bindir=/usr/bin \ 96 --libdir=/usr/lib/${MACH64} \ 97 --includedir=/usr/include \ 98 --mandir=/usr/share/man) 99 100 $(VER)/configure: $(VER).tar.gz 101 gzip -dc $(VER).tar.gz | $(GTAR) xpf - --no-same-owner 102 (cd $(VER); gpatch -p1 < ../docs.patch) 103 (cd $(VER); gpatch -p1 < ../tests.patch) 104 touch $(VER)/configure 105 106 $(VER64)/configure: $(VER).tar.gz 107 mkdir -p tmp 108 gzip -dc $(VER).tar.gz | (cd tmp; $(GTAR) xpf - --no-same-owner) 109 rm -rf $(VER64) 110 mv tmp/$(VER) $(VER64); rmdir tmp 111 (cd $(VER64); gpatch -p1 < ../docs.patch) 112 (cd $(VER64); gpatch -p1 < ../tests.patch) 113 touch $(VER64)/configure 114 115 clean: 116 -rm -rf \ 117 $(VER) \ 118 $(VER64) 119 120 install_h: 121 122 include ../Makefile.targ 123