10Sstevel@tonic-gate# 20Sstevel@tonic-gate# CDDL HEADER START 30Sstevel@tonic-gate# 40Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5580Swesolows# Common Development and Distribution License (the "License"). 6580Swesolows# You may not use this file except in compliance with the License. 70Sstevel@tonic-gate# 80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate# See the License for the specific language governing permissions 110Sstevel@tonic-gate# and limitations under the License. 120Sstevel@tonic-gate# 130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate# 190Sstevel@tonic-gate# CDDL HEADER END 200Sstevel@tonic-gate# 21580Swesolows 220Sstevel@tonic-gate# 23*9507SJerry.Gilliam@Sun.COM# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate# Use is subject to license terms. 250Sstevel@tonic-gate# 26580Swesolows 270Sstevel@tonic-gate# 280Sstevel@tonic-gate# This makefile drives the production of unix (and unix.o). 290Sstevel@tonic-gate# 300Sstevel@tonic-gate# sun4u starcat implementation architecture dependent 310Sstevel@tonic-gate# 320Sstevel@tonic-gate 330Sstevel@tonic-gate# 340Sstevel@tonic-gate# Path to the base of the uts directory tree (usually /usr/src/uts). 350Sstevel@tonic-gate# 360Sstevel@tonic-gateUTSBASE = ../../.. 370Sstevel@tonic-gate 380Sstevel@tonic-gate# 390Sstevel@tonic-gate# Define the module and object file sets. 400Sstevel@tonic-gate# 410Sstevel@tonic-gateUNIX = unix 420Sstevel@tonic-gateOBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \ 430Sstevel@tonic-gate $(CORE_OBJS:%=$(OBJS_DIR)/%) \ 440Sstevel@tonic-gate $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%) 450Sstevel@tonic-gateLINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 460Sstevel@tonic-gate $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 470Sstevel@tonic-gate $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \ 480Sstevel@tonic-gate $(LINTS_DIR)/vers.ln \ 490Sstevel@tonic-gate $(LINTS_DIR)/modstubs.ln 505648Ssetje 515648SsetjeKRTLD_MAPFILE = $(UTSBASE)/sparc/krtld/mapfile 525648SsetjeKRTLD_OBJECTS = $(KRTLD_OBJS:%=$(OBJS_DIR)/%) 535648SsetjeKRTLD_O = $(OBJS_DIR)/krtld.o 545648Ssetje 550Sstevel@tonic-gateROOTMODULE = $(ROOT_STARCAT_KERN_DIR)/$(UNIX) 560Sstevel@tonic-gateUNIX_BIN = $(OBJS_DIR)/$(UNIX) 570Sstevel@tonic-gate 580Sstevel@tonic-gateLIBS = $(GENLIB) $(PLATLIB) $(CPULIB) 590Sstevel@tonic-gate 600Sstevel@tonic-gateGENUNIX = genunix 610Sstevel@tonic-gateGENUNIX_DIR = ../../$(GENUNIX) 620Sstevel@tonic-gateGENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX) 630Sstevel@tonic-gate 640Sstevel@tonic-gateCPU_DIR = . 650Sstevel@tonic-gateCPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME) 660Sstevel@tonic-gate 670Sstevel@tonic-gatePLAT_DIR = ../../platmod 680Sstevel@tonic-gatePLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD) 690Sstevel@tonic-gate 700Sstevel@tonic-gateLIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS) 710Sstevel@tonic-gate 720Sstevel@tonic-gateCTFEXTRAOBJS = $(OBJS_DIR)/vers.o 730Sstevel@tonic-gate 740Sstevel@tonic-gate# 750Sstevel@tonic-gate# Include common rules. 760Sstevel@tonic-gate# 770Sstevel@tonic-gateinclude $(UTSBASE)/sun4u/starcat/Makefile.starcat 780Sstevel@tonic-gate 790Sstevel@tonic-gate# 800Sstevel@tonic-gate# Define targets 810Sstevel@tonic-gate# 820Sstevel@tonic-gateALL_TARGET = $(UNIX_BIN) 830Sstevel@tonic-gateLINT_TARGET = $(LINT_LIB) 840Sstevel@tonic-gateINSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE) 850Sstevel@tonic-gate 860Sstevel@tonic-gate# 870Sstevel@tonic-gate# Overrides 880Sstevel@tonic-gate# 890Sstevel@tonic-gateALL_BUILDS = $(ALL_BUILDSONLY64) 900Sstevel@tonic-gateDEF_BUILDS = $(DEF_BUILDSONLY64) 910Sstevel@tonic-gateSYM_BUILDS = $(DEF_BUILDSONLY64) 920Sstevel@tonic-gateCLEANLINTFILES += $(LINT32_FILES) 930Sstevel@tonic-gate 940Sstevel@tonic-gate# 950Sstevel@tonic-gate# This is UNIX_DIR. Use a short path. 960Sstevel@tonic-gate# 970Sstevel@tonic-gateUNIX_DIR = . 980Sstevel@tonic-gate 990Sstevel@tonic-gate# 1000Sstevel@tonic-gate# Overrides 1010Sstevel@tonic-gate# 1025648SsetjeCLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(KRTLD_O) $(KRTLD_OBJECTS) \ 1035648Ssetje $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \ 1045648Ssetje $(CPU_OBJ) $(CPULIB) \ 1050Sstevel@tonic-gate $(DTRACESTUBS_O) $(DTRACESTUBS) 1060Sstevel@tonic-gate 1070Sstevel@tonic-gateCLOBBERFILES = $(CLEANFILES) $(UNIX_BIN) 1080Sstevel@tonic-gateCLEANLINTFILES += $(LINT_LIB) 1090Sstevel@tonic-gate 1100Sstevel@tonic-gate# 1110Sstevel@tonic-gate# lint pass one enforcement 1120Sstevel@tonic-gate# Turn on doubleword alignment for 64 bit counter timer registers 1130Sstevel@tonic-gate# 1140Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) -dalign 1150Sstevel@tonic-gate 1160Sstevel@tonic-gate# 1170Sstevel@tonic-gate# Default build targets. 1180Sstevel@tonic-gate# 1190Sstevel@tonic-gate.KEEP_STATE: 1200Sstevel@tonic-gate 1210Sstevel@tonic-gatedef: $(DEF_DEPS) 1220Sstevel@tonic-gate 1230Sstevel@tonic-gateall: $(ALL_DEPS) 1240Sstevel@tonic-gate 1250Sstevel@tonic-gateclean: $(CLEAN_DEPS) 1260Sstevel@tonic-gate 1270Sstevel@tonic-gateclobber: $(CLOBBER_DEPS) 1280Sstevel@tonic-gate 1290Sstevel@tonic-gatelint: $(LINT_DEPS) 1300Sstevel@tonic-gate 1310Sstevel@tonic-gateclean.lint: $(CLEAN_LINT_DEPS) 1320Sstevel@tonic-gate 1330Sstevel@tonic-gateinstall: $(INSTALL_DEPS) 1340Sstevel@tonic-gate 1350Sstevel@tonic-gatesymcheck: $(SYM_DEPS) 1360Sstevel@tonic-gate 1375648Ssetje$(UNIX_BIN): $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) \ 1385648Ssetje $(DTRACESTUBS) 1395648Ssetje $(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \ 1405648Ssetje $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 1410Sstevel@tonic-gate $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX) 1420Sstevel@tonic-gate $(POST_PROCESS) 143*9507SJerry.Gilliam@Sun.COM $(CHK4UBINARY) 1440Sstevel@tonic-gate 1455648Ssetjesymcheck.targ: $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS) 1460Sstevel@tonic-gate $(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \ 1475648Ssetje $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 1480Sstevel@tonic-gate 1490Sstevel@tonic-gate$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o 1500Sstevel@tonic-gate $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o 1510Sstevel@tonic-gate 1525648Ssetje$(KRTLD_O): $(KRTLD_OBJECTS) 1535648Ssetje $(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS) 1545648Ssetje 1550Sstevel@tonic-gate# 1560Sstevel@tonic-gate# CPU_OBJ now comprises of 2 object files which come from sun4 common 1570Sstevel@tonic-gate# and from architecture dependent code. OBJS_DIR is prepended where 1580Sstevel@tonic-gate# CPU_DIR is defined to allow for building multiple CPU_OBJ's 1590Sstevel@tonic-gate# 1600Sstevel@tonic-gate$(CPULIB): $(CPU_OBJ) 161580Swesolows $(BUILD.SO) $(CPU_OBJ) 1620Sstevel@tonic-gate 1630Sstevel@tonic-gate# 1640Sstevel@tonic-gate# The global lint target builds the kernel lint library (llib-lunix.ln) 1650Sstevel@tonic-gate# which is equivalent to a lint of /unix.o. Then all kernel modules for 1660Sstevel@tonic-gate# this architecture are linted against the kernel lint library. 1670Sstevel@tonic-gate# 1680Sstevel@tonic-gate# Note: lint errors in the kernel lint library will be repeated for 1690Sstevel@tonic-gate# each module. It is important that the kernel lint library 1700Sstevel@tonic-gate# be clean to keep the textual output to a reasonable level. 1710Sstevel@tonic-gate# 1720Sstevel@tonic-gate 1730Sstevel@tonic-gate$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS) 1740Sstevel@tonic-gate @-$(ECHO) "\n$(UNIX): (library construction):" 1750Sstevel@tonic-gate @$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS) 1760Sstevel@tonic-gate @$(MV) $(@F) $@ 1770Sstevel@tonic-gate 1780Sstevel@tonic-gatelintlib: $(LINT_DEPS) 1790Sstevel@tonic-gate 1800Sstevel@tonic-gate# 1810Sstevel@tonic-gate# Include common targets. 1820Sstevel@tonic-gate# 1830Sstevel@tonic-gateinclude $(UTSBASE)/sun4u/starcat/Makefile.targ 184