Makefile revision bb25c06cca41ca78e5fb87fbb8e81d55beb18c95
0N/A#
2362N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License (the "License").
0N/A# You may not use this file except in compliance with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
2362N/A# CDDL HEADER END
2362N/A#
2362N/A
0N/A#
0N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
0N/A# Use is subject to license terms.
0N/A#
0N/A# ident "%Z%%M% %I% %E% SMI"
0N/A#
0N/A
0N/A#
0N/A# This makefile drives the production of /unix (and unix.o).
0N/A#
0N/A# sun4v implementation architecture dependent
0N/A#
0N/A
0N/A#
0N/A# Path to the base of the uts directory tree (usually /usr/src/uts).
0N/A#
0N/AUTSBASE = ../..
0N/A
0N/A#
0N/A# Define the module and object file sets.
0N/A#
0N/AUNIX = unix
0N/AOBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
0N/A $(CORE_OBJS:%=$(OBJS_DIR)/%) \
0N/A $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
0N/ALINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
0N/A $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
0N/A $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
0N/A $(LINTS_DIR)/vers.ln \
0N/A $(LINTS_DIR)/modstubs.ln
0N/AROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(UNIX)
0N/AUNIX32_LINK = $(ROOT_PSM_KERN_DIR_32)/$(UNIX)
0N/AUNIX_BIN = $(OBJS_DIR)/$(UNIX)
0N/A
0N/AKRTLD_32 = misc/krtld
0N/AKRTLD_64 = misc/$(SUBDIR64)/krtld
0N/AKRTLD = $(KRTLD_$(CLASS))
0N/A
0N/ALIBS = $(GENLIB) $(PLATLIB) $(CPULIB)
0N/A
0N/AGENUNIX = genunix
0N/AGENUNIX_DIR = ../$(GENUNIX)
0N/AGENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
0N/A
0N/ACPU_DIR = .
0N/ACPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
0N/A
0N/APLAT_DIR = ../platmod
0N/APLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
0N/A
0N/ALIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
0N/A
0N/ACTFEXTRAOBJS = $(OBJS_DIR)/vers.o
0N/A
0N/A#
0N/A# Include common rules.
0N/A#
0N/Ainclude $(UTSBASE)/sun4v/Makefile.sun4v
0N/A
0N/A#
0N/A# Define targets
0N/A#
0N/AALL_TARGET = $(UNIX_BIN)
0N/ALINT_TARGET = $(LINT_LIB)
0N/AINSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE) $(UNIX32_LINK)
0N/A
0N/A#
0N/A# This is UNIX_DIR. Use a short path.
0N/A#
0N/AUNIX_DIR = .
0N/A
0N/A#
0N/A# Overrides
0N/A#
0N/ACLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(OBJS_DIR)/vers.c \
0N/A $(OBJS_DIR)/vers.o $(CPU_OBJ) $(CPULIB) \
0N/A $(DTRACESTUBS_O) $(DTRACESTUBS)
0N/A
0N/ACLOBBERFILES = $(CLEANFILES) $(UNIX_BIN)
0N/ACLEANLINTFILES += $(LINT_LIB)
0N/A
0N/A#
0N/A# lint pass one enforcement
0N/A# Turn on doubleword alignment for 64 bit counter timer registers
0N/A#
0N/ACFLAGS += $(CCVERBOSE) -dalign
0N/A
0N/A#
0N/A# For now, disable these lint checks; maintainers should endeavor
0N/A# to investigate and remove these for maximum lint coverage.
0N/A# Please do not carry these forward to new Makefiles.
0N/A#
0N/ALINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
0N/ALINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
0N/ALINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
0N/ALINTTAGS += -erroff=E_STATIC_UNUSED
0N/ALINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
0N/ALINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
0N/A
0N/A#
0N/A# Default build targets.
0N/A#
0N/A.KEEP_STATE:
0N/A
0N/Adef: $(DEF_DEPS)
all: $(ALL_DEPS)
clean: $(CLEAN_DEPS)
clobber: $(CLOBBER_DEPS)
lint: $(LINT_DEPS)
clean.lint: $(CLEAN_LINT_DEPS)
install: $(INSTALL_DEPS)
$(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) $(DTRACESTUBS)
$(LD) -dy -b -o $@ -e _start -I $(KRTLD) -M $(MAPFILE) \
$(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
$(POST_PROCESS)
$(UNIX32_LINK): $(ROOT_PSM_KERN_DIR_32) $(UNIX_BIN)
-$(RM) $@; ln -s $(SUBDIR64)/$(UNIX) $@
symcheck: $(UNIX_O) $(MODSTUBS_O) $(LIBS)
$(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
$(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
#$(UNIX).glom: $(UNIX)
# ${LD} -dy -b -z nodefs -o $@ -e _start -I $(KRTLD) -M $(MAPFILE) \
# $(UNIX_O) $(MODSTUBS_O) $(GENUNIX_DIR)/$(GENUNIX)
# $(POST_PROCESS)
$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
$(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
#
# Special rules for generating assym.h for inclusion in assembly files.
#
$(DSF_DIR)/$(OBJS_DIR)/assym.h: FRC
@cd $(DSF_DIR); $(MAKE) all.targ
$(GENLIB): FRC
@(cd $(GENLIB_DIR); pwd; $(MAKE) all.targ)
@pwd
$(PLATLIB):
?@(cd $(PLAT_DIR); pwd; $(MAKE) all.targ)
?@pwd
#
# CPU_OBJ now comprises of 2 object files which come from sun4 common
# and from architecture dependent code. OBJS_DIR is prepended where
# CPU_OBJ is defined to allow for building multiple CPU_OBJ's
#
$(CPULIB): $(CPU_OBJ)
$(BUILD.SO) $(CPU_OBJ)
#
# The global lint target builds the kernel lint library (llib-lunix.ln)
# which is equivalent to a lint of /unix.o. Then all kernel modules for
# this architecture are linted against the kernel lint library.
#
# Note: lint errors in the kernel lint library will be repeated for
# each module. It is important that the kernel lint library
# be clean to keep the textual output to a reasonable level.
#
$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
@-$(ECHO) "\n$(UNIX): (library construction):"
@$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS)
@$(MV) $(@F) $@
lintlib: $(LINT_DEPS)
#
# Include common targets.
#
include $(UTSBASE)/$(PLATFORM)/Makefile.targ