#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)Makefile.sfw 1.7 09/10/15 SMI"
VER=memcached-1.4.15
VER64=$(VER)-64
include ../Makefile.lib
CFLAGS += -mt -xO5 -xtarget=generic -xstrconst
CFLAGS64 += -mt -xO5 $(CCBITS64) -xstrconst
CONFIGURE_OPTIONS += --enable-dtrace --disable-docs --disable-coverage
CONFIGURE_OPTIONS += --localstatedir=/var
CONFIGURE_OPTIONS32 = $(CONFIGURE_OPTIONS)
CONFIGURE_OPTIONS32 += --with-libevent=${ROOT}/usr
CONFIGURE_OPTIONS64 = $(CONFIGURE_OPTIONS)
CONFIGURE_OPTIONS64 += --with-libevent=${ROOT}/usr/lib/${MACH64}
all: all32 all64 isaexecwrapper
all32: $(VER)/config.status
(cd $(VER); env \
CC=$(CC) "CFLAGS=$(CFLAGS)" "LDFLAGS=-mt -L${ROOT}/usr/lib -lnsl" \
PATH=$(SFW_PATH) \
MAKE=$(CCSMAKE) \
$(CCSMAKE))
all64: $(VER64)/config.status
(cd $(VER64); env \
CC=$(CC64) "CFLAGS=$(CFLAGS64)" "LDFLAGS=-mt -L${ROOT}/usr/lib/${MACH64} -lnsl" \
PATH=$(SFW_PATH) \
MAKE=$(CCSMAKE) \
$(CCSMAKE))
isaexecwrapper: ./memcached.c
$(CC) $(CFLAGS) -o memcached memcached.c
install: all
MACH32=$(MACH32) $(SH) ./install-sfw
MACH64=$(MACH64) $(SH) ./install-sfw-64
$(VER)/config.status: $(VER)/configure
(cd $(VER); env \
CC=$(CC) "CFLAGS=$(CFLAGS)" "LDFLAGS=-mt -lnsl" \
PATH=$(SFW_PATH) \
MAKE=$(CCSMAKE) \
./configure $(CONFIGURE_OPTIONS32))
$(VER64)/config.status: $(VER64)/configure
(cd $(VER64); env \
CC=$(CC64) "CFLAGS=$(CFLAGS64)" "LDFLAGS=-mt -lnsl" \
PATH=$(SFW_PATH) \
MAKE=$(CCSMAKE) \
./configure $(CONFIGURE_OPTIONS64))
$(VER)/configure: $(VER).tar.gz
gzip -dc $(VER).tar.gz | tar xopf -
touch $(VER)/configure
$(VER64)/configure: $(VER).tar.gz
mkdir -p tmp
gzip -dc $(VER).tar.gz | (cd tmp; tar xopf -)
rm -rf $(VER64)
mv tmp/$(VER) $(VER64); rmdir tmp
touch $(VER64)/configure
clean:
-rm -rf memcached \
$(VER) \
$(VER64)
install_h:
include ../Makefile.targ