Makefile revision 24da5b34f49324ed742a340010ed5bd3d4e06625
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CDDL HEADER START
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# The contents of this file are subject to the terms of the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Common Development and Distribution License (the "License").
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# You may not use this file except in compliance with the License.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# or http://www.opensolaris.org/os/licensing.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# See the License for the specific language governing permissions
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# and limitations under the License.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# When distributing Covered Code, include this CDDL HEADER in each
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# If applicable, add the following below this CDDL HEADER, with the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# fields enclosed by brackets "[]" replaced with your own identifying
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# information: Portions Copyright [yyyy] [name of copyright owner]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CDDL HEADER END
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Use is subject to license terms.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# ident "%Z%%M% %I% %E% SMI"
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# This makefile drives the production of unix (and unix.o).
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# sun4u starfire implementation architecture dependent
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Path to the base of the uts directory tree (usually /usr/src/uts).
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesUTSBASE = ../../..
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Define the module and object file sets.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesUNIX = unix
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesOBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(CORE_OBJS:%=$(OBJS_DIR)/%) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(LINTS_DIR)/vers.ln \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(LINTS_DIR)/modstubs.ln
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesROOTMODULE = $(ROOT_STARFIRE_KERN_DIR)/$(UNIX)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesUNIX32_LINK = $(ROOT_STARFIRE_KERN_DIR_32)/$(UNIX)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesUNIX_BIN = $(OBJS_DIR)/$(UNIX)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesKRTLD_32 = misc/krtld
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesKRTLD_64 = misc/$(SUBDIR64)/krtld
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesKRTLD = $(KRTLD_$(CLASS))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLIBS = $(GENLIB) $(PLATLIB) $(CPULIB)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesGENUNIX = genunix
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesGENUNIX_DIR = ../../$(GENUNIX)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesGENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCPU_DIR = .
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesPLAT_DIR = ../../platmod
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesPLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCTFEXTRAOBJS = $(OBJS_DIR)/vers.o
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Include common rules.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesinclude $(UTSBASE)/sun4u/starfire/Makefile.starfire
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Define targets
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesALL_TARGET = $(UNIX_BIN)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLINT_TARGET = $(LINT_LIB)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesINSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE) $(UNIX32_LINK)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# This is UNIX_DIR. Use a short path.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesUNIX_DIR = .
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Overrides
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(OBJS_DIR)/vers.c \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(OBJS_DIR)/vers.o $(CPU_OBJ) $(CPULIB) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(DTRACESTUBS_O) $(DTRACESTUBS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCLOBBERFILES = $(CLEANFILES) $(UNIX_BIN)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCLEANLINTFILES += $(LINT_LIB)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# lint pass one enforcement
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Turn on doubleword alignment for 64 bit counter timer registers
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCFLAGS += $(CCVERBOSE) -dalign
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Default build targets.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.KEEP_STATE:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesdef: $(DEF_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesall: $(ALL_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesclean: $(CLEAN_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesclobber: $(CLOBBER_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
0a39e7683f6611d66c55712f50bb240428d832a1bnicholeslint: $(LINT_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesclean.lint: $(CLEAN_LINT_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesinstall: $(INSTALL_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) $(DTRACESTUBS)
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes $(LD) -dy -b -o $@ -e _start -I $(KRTLD) -M $(MAPFILE) \
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes $(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes $(POST_PROCESS)
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes
036436f4f4cdcd76186c0058891216545967043bbnicholes$(UNIX32_LINK): $(ROOT_PSM_KERN_DIR_32) $(UNIX_BIN)
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes -$(RM) $@; ln -s $(SUBDIR64)/$(UNIX) $@
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessymcheck: $(UNIX_O) $(MODSTUBS_O) $(LIBS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Special rules for generating assym.h for inclusion in assembly files.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(DSF_DIR)/$(OBJS_DIR)/assym.h: FRC
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @cd $(DSF_DIR); $(MAKE) all.targ
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(GENLIB): FRC
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @(cd $(GENLIB_DIR); pwd; $(MAKE) all.targ)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @pwd
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(PLATLIB):
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ?@(cd $(PLAT_DIR); pwd; $(MAKE) all.targ)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ?@pwd
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CPU_OBJ now comprises of 2 object files which come from sun4 common
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# and from architecture dependent code. OBJS_DIR is prepended where
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CPU_OBJ is defined to allow for building multiple CPU_OBJ's
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(CPULIB): $(CPU_OBJ)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(BUILD.SO) $(CPU_OBJ)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# The global lint target builds the kernel lint library (llib-lunix.ln)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# which is equivalent to a lint of /unix.o. Then all kernel modules for
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# this architecture are linted against the kernel lint library.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Note: lint errors in the kernel lint library will be repeated for
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# each module. It is important that the kernel lint library
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# be clean to keep the textual output to a reasonable level.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @-$(ECHO) "\n$(UNIX): (library construction):"
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @$(MV) $(@F) $@
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholeslintlib: $(LINT_DEPS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Include common targets.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesinclude $(UTSBASE)/sun4u/starfire/Makefile.targ
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes