#
# 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.1 09/10/07 SMI"
#
include ../Makefile.cmd
VER = $(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
VER64 = $(VER)-64
TARBALL = $(VER).tar.gz
PATCHES:sh = echo Patches/*.patch
CONFIGURE_GENERIC = LDFLAGS="$(LDFLAGS)"
CONFIGURE_GENERIC += PATH=$(SFW_PATH)
CONFIGURE_GENERIC += MAKE="$(CCSMAKE)"
CONFIGURE_GENERIC += INSTALL="/usr/bin/ginstall"
PRE_CONFIGURE = CC="$(CC)"
PRE_CONFIGURE += CFLAGS="$(CFLAGS)"
PRE_CONFIGURE += $(CONFIGURE_GENERIC)
PRE_CONFIGURE_64 = CC="$(CC64)"
PRE_CONFIGURE_64 += CFLAGS="$(CFLAGS64)"
PRE_CONFIGURE_64 += $(CONFIGURE_GENERIC)
CONFIGURE_OPTIONS_32 = --bindir=/usr/bin
CONFIGURE_OPTIONS_32 += --libdir=/usr/lib
CONFIGURE_OPTIONS_32 += LDFLAGS=-L$(ROOTLIB)
CONFIGURE_OPTIONS_64 = --bindir=/usr/bin/$(MACH64)
CONFIGURE_OPTIONS_64 += --libdir=/usr/lib/$(MACH64)
CONFIGURE_OPTIONS_64 += LDFLAGS=-L$(ROOTLIB64)
all: all32 install32 all64 install64
all32: $(VER)/config.status
(cd $(VER); \
env - "CFLAGS=$(CFLAGS)" $(CONFIGURE_GENERIC) $(CCSMAKE))
all64: $(VER64)/config.status
(cd $(VER64); \
env - "CFLAGS=$(CFLAGS64)" $(CONFIGURE_GENERIC) $(CCSMAKE))
test32:
(cd $(VER); \
env - "LD_OPTIONS=-R$(ROOTLIB)" $(CCSMAKE) check)
test64:
(cd $(VER64); \
env - "LD_OPTIONS=-R$(ROOTLIB64)" $(CCSMAKE) check)
install: all
$(SRC)/tools/protofix --perm --pkg $(COMPONENT_PACKAGES:sh)
install32:
$(SHELL) ./install-sfw $(VER)
install64:
$(SHELL) ./install-sfw $(VER64) $(MACH64)
$(VER)/config.status: $(VER)/configure
(cd $(VER); \
env - $(PRE_CONFIGURE) $(SHELL) ./configure $(CONFIGURE_OPTIONS_32))
$(VER64)/config.status: $(VER64)/configure
(cd $(VER64); \
env - $(PRE_CONFIGURE_64) $(SHELL) ./configure $(CONFIGURE_OPTIONS_64))
$(VER)/configure: $(VER)/.patched
$(TOUCH) $@
$(VER64)/configure: $(VER64)/.patched
$(TOUCH) $@
clean:
-$(RM) -rf $(VER) $(VER64)
include ../Makefile.targ