Makefile revision 9507:e6271d3ec9f2
166458Sdfr# 266458Sdfr# CDDL HEADER START 366458Sdfr# 466458Sdfr# The contents of this file are subject to the terms of the 566458Sdfr# Common Development and Distribution License (the "License"). 666458Sdfr# You may not use this file except in compliance with the License. 766458Sdfr# 866458Sdfr# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 966458Sdfr# or http://www.opensolaris.org/os/licensing. 1066458Sdfr# See the License for the specific language governing permissions 1166458Sdfr# and limitations under the License. 1266458Sdfr# 1366458Sdfr# When distributing Covered Code, include this CDDL HEADER in each 1466458Sdfr# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1566458Sdfr# If applicable, add the following below this CDDL HEADER, with the 1666458Sdfr# fields enclosed by brackets "[]" replaced with your own identifying 1766458Sdfr# information: Portions Copyright [yyyy] [name of copyright owner] 1866458Sdfr# 1966458Sdfr# CDDL HEADER END 2066458Sdfr# 2166458Sdfr 2266458Sdfr# 2366458Sdfr# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2466458Sdfr# Use is subject to license terms. 2566458Sdfr# 2666458Sdfr 2766458Sdfr# 2866458Sdfr# This makefile drives the production of unix (and unix.o). 2966458Sdfr# 3066458Sdfr# sun4u implementation architecture dependent 3166458Sdfr# 3266458Sdfr 3366458Sdfr# 3466458Sdfr# Path to the base of the uts directory tree (usually /usr/src/uts). 3566458Sdfr# 3666458SdfrUTSBASE = ../.. 3766458Sdfr 3866458Sdfr# 3966458Sdfr# Define the module and object file sets. 4066458Sdfr# 4166458SdfrUNIX = unix 4266458SdfrOBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \ 4366458Sdfr $(CORE_OBJS:%=$(OBJS_DIR)/%) \ 4466458Sdfr $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%) 4566458SdfrLINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 4666458Sdfr $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 4766458Sdfr $(KRTLD_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 4866458Sdfr $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \ 4966458Sdfr $(LINTS_DIR)/vers.ln \ 5066458Sdfr $(LINTS_DIR)/modstubs.ln 5166458Sdfr 5266458SdfrKRTLD_MAPFILE = $(UTSBASE)/sparc/krtld/mapfile 5366458SdfrKRTLD_OBJECTS = $(KRTLD_OBJS:%=$(OBJS_DIR)/%) 5466458SdfrKRTLD_O = $(OBJS_DIR)/krtld.o 5566458Sdfr 5666458SdfrROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(UNIX) 5766458SdfrUNIX32_LINK = $(ROOT_PSM_KERN_DIR_32)/$(UNIX) 5866458SdfrUNIX_BIN = $(OBJS_DIR)/$(UNIX) 5966458Sdfr#UNIX_GLOM = $(OBJS_DIR)/unix.glom 6066458Sdfr 6166458SdfrLIBS = $(GENLIB) $(PLATLIB) $(CPULIB) 6266458Sdfr 6366458SdfrGENUNIX = genunix 6466458SdfrGENUNIX_DIR = ../$(GENUNIX) 6566458SdfrGENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX) 6666633Sdfr 6766458SdfrCPU_DIR = . 6866633SdfrCPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME) 6966633Sdfr 7066633SdfrPLAT_DIR = ../platmod 7166458SdfrPLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD) 7266633Sdfr 7366633SdfrLIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS) 7466633Sdfr 7566633SdfrCTFEXTRAOBJS = $(OBJS_DIR)/vers.o 7666633Sdfr 7766633Sdfr# 7866633Sdfr# Include common rules. 7966633Sdfr# 8066633Sdfrinclude $(UTSBASE)/sun4u/Makefile.sun4u 8166633Sdfr 8266633Sdfr# 8366633Sdfr# Define targets 8466633Sdfr# 8566633SdfrALL_TARGET = $(UNIX_BIN) 8666633SdfrLINT_TARGET = $(LINT_LIB) 8766633SdfrINSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE) $(UNIX32_LINK) 8866458Sdfr 8966633Sdfr# 9066633Sdfr# This is UNIX_DIR. Use a short path. 9166458Sdfr# 9266486SdfrUNIX_DIR = . 9366458Sdfr 9466633Sdfr# 9566458Sdfr# Overrides 9666633Sdfr# 9766633SdfrCLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(KRTLD_O) $(KRTLD_OBJECTS) \ 9866633Sdfr $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \ 9966458Sdfr $(CPU_OBJ) $(CPULIB) \ 10066633Sdfr $(DTRACESTUBS_O) $(DTRACESTUBS) 10166633Sdfr 10266633SdfrCLOBBERFILES = $(CLEANFILES) $(UNIX_BIN) 10366633SdfrCLEANLINTFILES += $(LINT_LIB) 10466633Sdfr 10566633Sdfr# 10666633Sdfr# lint pass one enforcement 10766633Sdfr# Turn on doubleword alignment for 64 bit counter timer registers 10866633Sdfr# 10966633SdfrCFLAGS += $(CCVERBOSE) -dalign 11066633Sdfr 11166633Sdfr# 11266633Sdfr# For now, disable these lint checks; maintainers should endeavor 11366633Sdfr# to investigate and remove these for maximum lint coverage. 11466633Sdfr# Please do not carry these forward to new Makefiles. 11566633Sdfr# 11666458SdfrLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 11766633SdfrLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 11866633SdfrLINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 11966458SdfrLINTTAGS += -erroff=E_STATIC_UNUSED 12066486SdfrLINTTAGS += -erroff=E_PTRDIFF_OVERFLOW 12166458SdfrLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 12266633Sdfr 12366458Sdfr# 12466633Sdfr# Default build targets. 12566633Sdfr# 12666633Sdfr.KEEP_STATE: 12766458Sdfr 12866633Sdfrdef: $(DEF_DEPS) 12966633Sdfr 13066633Sdfrall: $(ALL_DEPS) 13166633Sdfr 13266633Sdfrclean: $(CLEAN_DEPS) 13366633Sdfr 13466633Sdfrclobber: $(CLOBBER_DEPS) 13566633Sdfr 13666633Sdfrlint: $(LINT_DEPS) 13766633Sdfr 13866633Sdfrclean.lint: $(CLEAN_LINT_DEPS) 13966633Sdfr 14066633Sdfrinstall: $(INSTALL_DEPS) 14166633Sdfr 14266633Sdfr 14366633Sdfr$(UNIX_BIN): $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) \ 14466458Sdfr $(DTRACESTUBS) 14566633Sdfr $(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \ 14666458Sdfr $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 14766486Sdfr $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX) 14866458Sdfr $(POST_PROCESS) 14966633Sdfr $(CHK4UBINARY) 15066458Sdfr 15166633Sdfr$(UNIX32_LINK): $(ROOT_PSM_KERN_DIR_32) $(UNIX_BIN) 15266633Sdfr -$(RM) $@; ln -s $(SUBDIR64)/$(UNIX) $@ 15366633Sdfr 15466458Sdfrsymcheck: $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS) 15566633Sdfr $(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \ 15666633Sdfr $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 15766633Sdfr 15866633Sdfr$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o 15966633Sdfr $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o 16066633Sdfr 16166633Sdfr$(KRTLD_O): $(KRTLD_OBJECTS) 16266633Sdfr $(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS) 16366633Sdfr 16466633Sdfr# 16566633Sdfr# CPU_OBJ now comprises of 2 object files which come from sun4 common 16666633Sdfr# and from architecture dependent code. OBJS_DIR is prepended where 16766633Sdfr# CPU_OBJ is defined to allow for building multiple CPU_OBJ's 16866633Sdfr# 16966633Sdfr$(CPULIB): $(CPU_OBJ) 17066633Sdfr $(BUILD.SO) $(CPU_OBJ) 17166458Sdfr 17266633Sdfr$(PLATLIB): 17366458Sdfr ?@(cd $(PLAT_DIR); pwd; $(MAKE) all.targ) 17466486Sdfr ?@pwd 17566458Sdfr 17666633Sdfr# 17766633Sdfr# The global lint target builds the kernel lint library (llib-lunix.ln) 17866633Sdfr# which is equivalent to a lint of /unix.o. Then all kernel modules for 17966633Sdfr# this architecture are linted against the kernel lint library. 18066458Sdfr# 18166633Sdfr# Note: lint errors in the kernel lint library will be repeated for 18266633Sdfr# each module. It is important that the kernel lint library 18366633Sdfr# be clean to keep the textual output to a reasonable level. 18466633Sdfr# 18566486Sdfr 18666458Sdfr$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS) 18766633Sdfr @pwd 18866633Sdfr @-$(ECHO) "\n$(UNIX): (library construction):" 18966633Sdfr @$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS) 19066633Sdfr @$(MV) $(@F) $@ 19166633Sdfr 19266486Sdfrlintlib: $(LINT_DEPS) 19366458Sdfr 19466458Sdfr# 19566458Sdfr# Include common targets. 19666458Sdfr# 19766458Sdfrinclude $(UTSBASE)/sun4u/Makefile.targ 19866458Sdfr 19966458Sdfr