usr/src/cmd/freeipmi/Makefile.sfw
author Jon Tibble <meths@btinternet.com>
Sun, 17 Feb 2013 18:32:42 +0000
branchoi_151a
changeset 205 c525cb3192e8
parent 0 b34509ac961f
permissions -rw-r--r--
Build FreeIPMI on a8

#
# 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.2	09/08/26 SMI"

include ../Makefile.cmd

VER = $(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
VER64 = $(VER)-64

TARBALL = $(VER).tar.gz

TARGET_ENV += CC="$(CC)"
TARGET_ENV += CFLAGS="$(CFLAGS) -g"
TARGET_ENV += CPP="$(CC) -Xs -E"
TARGET_ENV += CPPFLAGS="$(CPPFLAGS) -DMAXHOSTNAMELEN=256"
TARGET_ENV += PATH="$(SFW_PATH)"
TARGET_ENV += MAKE="$(CCSMAKE)"

TARGET_ENV_64 += CC="$(CC64)"
TARGET_ENV_64 += CFLAGS="$(CFLAGS64) -g"
TARGET_ENV_64 += CPP="$(CC64) -Xs -E"
TARGET_ENV_64 += CPPFLAGS="$(CPPFLAGS) -DMAXHOSTNAMELEN=256"
TARGET_ENV_64 += PATH="$(SFW_PATH)"
TARGET_ENV_64 += MAKE="$(CCSMAKE)"

MAKE_TARGET_ENV_64 += $(TARGET_ENV_64)
MAKE_TARGET_ENV_64 += LD_OPTIONS="-64"

#       configure(1) options to use
# a default --prefix and --mandir are set in Makefile.master
CONFIGURE_OPTIONS += --with-dont-check-for-root
CONFIGURE_OPTIONS += --sysconfdir=/etc
CONFIGURE_OPTIONS += --localstatedir=/var
CONFIGURE_OPTIONS += --infodir=/usr/share/doc/freeipmi/info
CONFIGURE_OPTIONS += --enable-static=no
CONFIGURE_OPTIONS += --enable-debug
CONFIGURE_OPTIONS += --mandir=/../../usr/src/cmd/freeipmi/prototmp/usr/share/man/tmp_freeipmi_man

CONFIGURE_OPTIONS_64 += $(CONFIGURE_OPTIONS)
CONFIGURE_OPTIONS_64 += --libdir=/usr/lib/$(MACH64)

#
# Targets
#

all: all32 all64

install: install64 .WAIT install32
	$(RM) $(ROOTETC)/init.d/freeipmi-ipmidetectd
	$(RM) $(ROOTETC)/init.d/freeipmi-bmc-watchdog
	# apply the file attributes from the packaging
	for pkg in $(COMPONENT_PACKAGES:sh) ; do \
		$(SRC)/tools/protofix --pkg $$pkg --perm ; \
	done

install32: all32
	(cd $(VER); \
	MAKE=$(CCSMAKE) \
	DESTDIR="$(ROOT)/" \
	INSTALL=/usr/bin/ginstall \
	$(CCSMAKE) install)
	(MACH64=$(MACH64) $(SHELL) ./install-sfw)

install64: all64
	(cd $(VER64); \
	MAKE=$(CCSMAKE) \
	DESTDIR="$(ROOT)/" \
	INSTALL=/usr/bin/ginstall \
	$(CCSMAKE) install)

all32: $(VER)/config.status
	(cd $(VER); env - $(TARGET_ENV) $(CCSMAKE) -e)

all64: $(VER64)/config.status
	(cd $(VER64); env - $(MAKE_TARGET_ENV_64) $(CCSMAKE) -e)

# Note: --sysconfigdir value is hardwired into the binaries. So we have
# to set it to /etc and redirect the installation by DESTDIR later.
# Note 2: single quote marks '\'' in manpages do problems with the default
# SunStudio CPP. We need to use -Xs .

$(VER)/config.status: $(VER)/configure
	(cd $(VER); env - $(TARGET_ENV) $(SHELL) ./configure $(CONFIGURE_OPTIONS))

$(VER64)/config.status: $(VER64)/configure
	(cd $(VER64); env - $(TARGET_ENV_64) $(SHELL) ./configure $(CONFIGURE_OPTIONS_64))

$(VER)/configure: $(VER)/.patched
	(cd $(VER); $(SHELL) ../man-fix)

$(VER64)/configure: $(VER64)/.patched
	(cd $(VER64); $(SHELL) ../man-fix)

clean:
	-rm -rf $(VER) $(VER64)

install_h:

include ../Makefile.targ