Makefile revision 986fd29a0dc13f7608ef7f508f6e700bd7bc2720
12N/A#
12N/A# CDDL HEADER START
12N/A#
12N/A# The contents of this file are subject to the terms of the
12N/A# Common Development and Distribution License (the "License").
12N/A# You may not use this file except in compliance with the License.
12N/A#
12N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12N/A# or http://www.opensolaris.org/os/licensing.
12N/A# See the License for the specific language governing permissions
12N/A# and limitations under the License.
12N/A#
12N/A# When distributing Covered Code, include this CDDL HEADER in each
12N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
12N/A# If applicable, add the following below this CDDL HEADER, with the
12N/A# fields enclosed by brackets "[]" replaced with your own identifying
12N/A# information: Portions Copyright [yyyy] [name of copyright owner]
12N/A#
12N/A# CDDL HEADER END
12N/A#
1980N/A
12N/A#
3321N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
12N/A# Use is subject to license terms.
12N/A#
3117N/A# ident "%Z%%M% %I% %E% SMI"
3177N/A#
30N/A
30N/A#
849N/A# This makefile drives the production of /unix (and unix.o).
1980N/A#
124N/A# sun4v implementation architecture dependent
124N/A#
2339N/A
2339N/A#
2339N/A# Path to the base of the uts directory tree (usually /usr/src/uts).
3261N/A#
181N/AUTSBASE = ../..
181N/A
430N/A#
30N/A# Define the module and object file sets.
2892N/A#
2892N/AUNIX = unix
2892N/AOBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
2892N/A $(CORE_OBJS:%=$(OBJS_DIR)/%) \
2892N/A $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
2892N/ALINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
2828N/A $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
2828N/A $(KRTLD_OBJS:%.o=$(LINTS_DIR)/%.ln) \
2828N/A $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
3261N/A $(LINTS_DIR)/vers.ln \
3339N/A $(LINTS_DIR)/modstubs.ln
3261N/A
3321N/AKRTLD_MAPFILE = $(UTSBASE)/sparc/krtld/mapfile
859N/AKRTLD_OBJECTS = $(KRTLD_OBJS:%=$(OBJS_DIR)/%)
859N/AKRTLD_O = $(OBJS_DIR)/krtld.o
3117N/A
12N/AROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(UNIX)
859N/AUNIX32_LINK = $(ROOT_PSM_KERN_DIR_32)/$(UNIX)
3177N/AUNIX_BIN = $(OBJS_DIR)/$(UNIX)
1980N/A
20N/ALIBS = $(GENLIB) $(PLATLIB) $(CPULIB)
859N/A
3177N/AGENUNIX = genunix
1980N/AGENUNIX_DIR = ../$(GENUNIX)
859N/AGENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
2339N/A
2339N/ACPU_DIR = .
2339N/ACPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
2339N/A
859N/APLAT_DIR = ../platmod
3117N/APLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
3339N/A
2339N/ALIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
2339N/A
3177N/ACTFEXTRAOBJS = $(OBJS_DIR)/vers.o
2665N/A
2339N/A#
2339N/A# Include common rules.
3177N/A#
2665N/Ainclude $(UTSBASE)/sun4v/Makefile.sun4v
2339N/A
2693N/A#
3117N/A# Define targets
3253N/A#
33N/AALL_TARGET = $(UNIX_BIN)
3261N/ALINT_TARGET = $(LINT_LIB)
3261N/AINSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE) $(UNIX32_LINK)
3261N/A
859N/A#
859N/A# This is UNIX_DIR. Use a short path.
859N/A#
859N/AUNIX_DIR = .
859N/A
859N/A#
422N/A# Overrides
1984N/A#
3261N/ACLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(KRTLD_O) $(KRTLD_OBJECTS) \
2626N/A $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \
3339N/A $(CPU_OBJ) $(CPULIB) \
30N/A $(DTRACESTUBS_O) $(DTRACESTUBS)
30N/A
3339N/ACLOBBERFILES = $(CLEANFILES) $(UNIX_BIN)
3339N/ACLEANLINTFILES += $(LINT_LIB)
181N/A
430N/A#
3177N/A# lint pass one enforcement
430N/A# Turn on doubleword alignment for 64 bit counter timer registers
2339N/A#
3177N/ACFLAGS += $(CCVERBOSE) -dalign
448N/A
859N/A#
# For now, disable these lint checks; maintainers should endeavor
# to investigate and remove these for maximum lint coverage.
# Please do not carry these forward to new Makefiles.
#
LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
LINTTAGS += -erroff=E_STATIC_UNUSED
LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
#
# Default build targets.
#
.KEEP_STATE:
def: $(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) $(KRTLD_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) \
$(DTRACESTUBS)
$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
$(UNIX_O) $(KRTLD_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) $(KRTLD_O) $(MODSTUBS_O) $(LIBS)
$(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
$(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
$(KRTLD_O): $(KRTLD_OBJECTS)
$(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS)
#
# 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