usr/src/Makefile.env
author David Powell <david.e.powell@oracle.com>
Wed, 13 Oct 2010 11:47:41 -0700
changeset 587 7093024d532b
parent 585 21a47246efe3
child 588 0b7566d15369
permissions -rw-r--r--
17210 Begin a developer guide

#
# 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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
#

#
# Common macros
#

PRE_POUND =	pre\#
POUND_SIGN =	$(PRE_POUND:pre\%=%)

# Installation directories
DOC_DIR = /usr/share/lib/java/javadoc
JAR_DIR = /usr/share/lib/java
LIB_DIR = /usr/lib
MFS_DIR = /lib/svc/manifest

PROTO_BIN         = $(ROOT)/usr/bin
PROTO_DOC         = $(ROOT)/$(DOC_DIR)
PROTO_ETC	  = $(ROOT)/etc
PROTO_ETC_CACAO   = $(ROOT)/etc/cacao/instances/default/modules
PROTO_ETC_VPANELS = $(ROOT)/etc/vpanels
PROTO_JAR         = $(ROOT)/$(JAR_DIR)
PROTO_LIB         = $(ROOT)/$(LIB_DIR)
PROTO_MFS_SYSTEM  = $(ROOT)$(MFS_DIR)/system
PROTO_MFS_NETWORK = $(ROOT)$(MFS_DIR)/network
PROTO_SHR         = $(ROOT)/lib/svc/share
PROTO_MTD         = $(ROOT)/lib/svc/method
PROTO_MTD_VP      = $(ROOT)/lib/svc/method/vp_methods
PROTO_SRC         = $(ROOT)/usr/share/lib/java/src
PROTO_APPS        = $(ROOT)/usr/share/applications
PROTO_AUTOSTART   = $(ROOT)/usr/share/gnome/autostart
PROTO_SCHEMA      = $(ROOT)/etc/gconf/schemas
PROTO_PYTHON      = $(ROOT)/usr/lib/python2.6/vendor-packages
PROTO_MDB         = $(ROOT)/usr/lib/mdb/proc
PROTO_MAN         = $(ROOT)/usr/share/man

ROOTHDRDIR        = $(ROOT)/usr/include

TOOLS_DIR = $(SRC)/tools

# Files generated during build removed during "make clean/clobber"
CLEAN_FILES =
CLOBBER_FILES = $(CLEAN_FILES)

# Install macros
DIRMODE = 755
INS.dir = $(INS) -s -d -m $(DIRMODE) $@
INS.file = $(INS) -s -d -m $(DIRMODE) $(@D); \
	$(RM) -- $@; $(INS) -s -m $(FILEMODE) -f $(@D) $(@F)
INS.pyfile = $(INS.file); $(TOUCH) -r $< $@

# Tools and dependencies used at build time
ISA:sh = uname -p
CHMOD = /usr/bin/chmod
CP = /usr/bin/cp
EGREP = /usr/bin/egrep
FIND = /usr/bin/find
GREP = /usr/bin/grep
GTAR = /usr/sfw/bin/gtar
HEAD = /usr/bin/head
INS = /usr/sbin/install
LS = /usr/bin/ls
MKDIR = /usr/bin/mkdir
PKG = /usr/bin/pkg
PKGMOGRIFY = /usr/bin/pkgmogrify
PKGSEND = /usr/bin/pkgsend
PWDCMD = /usr/bin/pwd
SED = /usr/bin/sed
SORT = /usr/bin/sort
TAR = /usr/bin/tar
WGET = /usr/bin/wget
XARGS = /usr/bin/xargs
PYTHON = /usr/bin/python
TOUCH = /usr/bin/touch
CTFMERGE = /opt/onbld/bin/$(ISA)/ctfmerge
CTFCONVERT = /opt/onbld/bin/$(ISA)/ctfconvert

# Set here explicitly to avoid compiling with newer class version
JAVAC = /usr/bin/javac
JAR = /usr/bin/jar
JAVADOC = /usr/bin/javadoc
JAVAH = /usr/bin/javah

# Consumers must depend on java (or java/adr)
ADRLOC=$(SRC)/java/adr/adr.jar
ADRGEN=java -classpath $(ADRLOC) org.opensolaris.os.adr.adrgen.ADRGen

# Cribbed from ON
ALWAYS_LINT_DEFS +=     -erroff=E_PTRDIFF_OVERFLOW
ALWAYS_LINT_DEFS +=     -erroff=E_ASSIGN_NARROW_CONV
ALWAYS_LINT_DEFS +=     -erroff=E_SEC_CREAT_WITHOUT_EXCL
ALWAYS_LINT_DEFS +=     -erroff=E_SEC_FORBIDDEN_WARN_CREAT
ALWAYS_LINT_DEFS +=     -erroff=E_ASSIGN_INT_TO_SMALL_INT
ALWAYS_LINT_DEFS +=     -erroff=E_CAST_INT_CONST_TO_SMALL_INT
ALWAYS_LINT_DEFS +=     -erroff=E_CAST_INT_TO_SMALL_INT
ALWAYS_LINT_DEFS +=     -erroff=E_CAST_TO_PTR_FROM_INT
ALWAYS_LINT_DEFS +=     -erroff=E_COMP_INT_WITH_LARGE_INT
ALWAYS_LINT_DEFS +=     -erroff=E_INTEGRAL_CONST_EXP_EXPECTED
ALWAYS_LINT_DEFS +=     -erroff=E_PASS_INT_TO_SMALL_INT
ALWAYS_LINT_DEFS +=     -erroff=E_PTR_CONV_LOSES_BITS

# Needed for generated files
ALWAYS_LINT_DEFS +=     -erroff=E_NAME_DEF_NOT_USED2

# Default to all subdirectories with a Makefile
SUBDIRS_CMD = $(LS) -1 */Makefile 2>/dev/null | $(SED) 's@/Makefile$$@@'
SUBDIRS = $(SUBDIRS_CMD:sh)

# Use CLASS_PATH instead of CLASS_PATH to avoid picking up environment
CLASS_PATH_ARRAY = $(DEPENDENCY_JARS)
CLASS_PATH_CMD = echo "$(CLASS_PATH_ARRAY)" | $(SED) 's/[ 	][ 	]*/:/g'
CLASS_PATH = $(CLASS_PATH_CMD:sh)

.SUFFIXES: .py .pyc

.py.pyc:
	$(RM) $@
	$(PYTHON) -mpy_compile $<
	@[ $(<)c = $@ ] || $(MV) $(<)c $@