#
#
# 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 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#pragma ident "@(#)Makefile 1.15 10/02/19 SMI"
#
# Makefile for sfw source
#
# include global definitions
include Makefile.master
#
# the Targetdirs file is the AT&T target.dirs file in a makefile format.
# it defines TARGETDIRS and ROOTDIRS.
include Targetdirs
# We don't have a ROOTDIRS equivalent for creating empty plain files,
# because there aren't enough of them to be worth generalizing.
# ROOTFILES_555 is a list of files that are created in the proto with
# mode 555 as placeholders for packaging purposes, but which are not
# delivered as final product.
#
# usr/lib/isaexec
# Placeholder stub for applications that want to
# use a hard link to /usr/lib/isaexec.
#
ROOTFILES_555= $(ROOT)/usr/lib/isaexec
COMMON_SUBDIRS= lib cmd
SUBDIRS= $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
HDRSUBDIRS= lib cmd
all := TARGET= all
install := TARGET= install
install_h := TARGET= install_h
clean := TARGET= clean
clobber := TARGET= clobber
meta-check := TARGET= meta-check
component-hook := TARGET= component-hook
#
# Note: install only builds the all target for the pkgdefs
# directory. We are not yet ready to have an install
# build create 'packages' also. To build packages
# cd pkgdefs and do a 'make install'
#
all: headers .WAIT tools .WAIT $(SUBDIRS) pkg_all
install: build_check .WAIT headers .WAIT tools .WAIT $(SUBDIRS) pkg_all
clean clobber: $(SUBDIRS) pkgdefs
meta-check component-hook: $(SUBDIRS)
# this is here only for findunref (for now)
lint:
pkg_all:
@cd pkgdefs; pwd; $(MAKE) all
headers: rootdirs .WAIT libheaders
rootdirs: $(ROOTDIRS) $(ROOTFILES_555)
$(ROOTDIRS):
$(INS.dir)
$(ROOTFILES_555) : $(ROOTDIRS)
touch $@
chmod 0555 $@
libheaders: FRC
@cd lib; pwd; $(MAKE) install_h
$(SUBDIRS) pkgdefs tools: FRC
@cd $@; echo "$(TARGET) \c"; pwd; $(MAKE) $(TARGET)
# top-level setup target to setup the development environment
# this includes headers and tools.
setup: build_check .WAIT headers .WAIT tools
# build_check - try to identify things known to (possibly)
# cause trouble so the mail message and log from nightly
# can point them out.
SFW_DANGER_DIRS= \
/opt/sfw/bin \
/opt/sfw/lib \
/opt/sfw/include \
/usr/local/bin \
/usr/local/lib \
/usr/local/include
build_check: FRC
@found=0 ; \
for dir in $(SFW_DANGER_DIRS) ; do \
if [ -d $$dir ]; then \
if [ $$found == 0 ]; then \
echo "Things that may affect the build." ; \
found=1; \
fi ; \
echo "\t$$dir"; \
fi \
done ; \
if [ $$found == 1 ]; then \
echo ; \
fi
cscope.out tags: FRC
$(XREF) -f -x $@
#
# Targets for reporting compiler versions; nightly uses these.
#
cc-version: build_check
@if [ -x "$($(MACH)_CC)" ]; then \
$(ECHO) 32-bit compiler; \
$(ECHO) $($(MACH)_CC); \
$($(MACH)_CC) -V 2>&1 | head -1; \
else \
__COMPILER=`$($(MACH)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
if [ -z "$$__COMPILER" ]; then \
$(ECHO) No 32-bit compiler found; \
exit 1; \
else \
$(ECHO) 32-bit compiler; \
$(ECHO) $($(MACH)_CC); \
$(ECHO) $$__COMPILER; \
$($(MACH)_CC) -V 2>&1 | head -1; \
fi; \
fi
cc64-version:
@if [ -x "$($(MACH64)_CC)" ]; then \
$(ECHO) 64-bit compiler; \
$(ECHO) $($(MACH64)_CC); \
$($(MACH64)_CC) -V 2>&1 | head -1; \
else \
__COMPILER=`$($(MACH64)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
if [ -z "$$__COMPILER" ]; then \
$(ECHO) No 64-bit compiler found; \
exit 1; \
else \
$(ECHO) 64-bit compiler; \
$(ECHO) $($(MACH64)_CC); \
$(ECHO) $$__COMPILER; \
$($(MACH64)_CC) -V 2>&1 | head -1; \
fi; \
fi
java-version:
@if [ -x "$(JAVAC)" ]; then \
$(ECHO) $(JAVAC); \
$(JAVA_ROOT)/bin/java -fullversion 2>&1 | head -1; \
else \
$(ECHO) No Java compiler found; \
exit 1; \
fi
FRC: