11772Sjl139090# 21772Sjl139090# CDDL HEADER START 31772Sjl139090# 41772Sjl139090# The contents of this file are subject to the terms of the 51772Sjl139090# Common Development and Distribution License (the "License"). 61772Sjl139090# You may not use this file except in compliance with the License. 71772Sjl139090# 81772Sjl139090# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91772Sjl139090# or http://www.opensolaris.org/os/licensing. 101772Sjl139090# See the License for the specific language governing permissions 111772Sjl139090# and limitations under the License. 121772Sjl139090# 131772Sjl139090# When distributing Covered Code, include this CDDL HEADER in each 141772Sjl139090# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151772Sjl139090# If applicable, add the following below this CDDL HEADER, with the 161772Sjl139090# fields enclosed by brackets "[]" replaced with your own identifying 171772Sjl139090# information: Portions Copyright [yyyy] [name of copyright owner] 181772Sjl139090# 191772Sjl139090# CDDL HEADER END 201772Sjl139090# 211772Sjl139090# 22*6094Sakolb# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 231772Sjl139090# Use is subject to license terms. 241772Sjl139090# 251772Sjl139090# ident "%Z%%M% %I% %E% SMI" 261772Sjl139090# 271772Sjl139090# This makefile drives the production of unix (and unix.o). 281772Sjl139090# 291772Sjl139090# sun4u opl implementation architecture dependent 301772Sjl139090# 311772Sjl139090# uts/sun4u/opl/unix/Makefile 321772Sjl139090# 331772Sjl139090 341772Sjl139090# 351772Sjl139090# Path to the base of the uts directory tree (usually /usr/src/uts). 361772Sjl139090# 371772Sjl139090UTSBASE = ../../.. 381772Sjl139090 391772Sjl139090# 401772Sjl139090# Define the module and object file sets. 411772Sjl139090# 421772Sjl139090UNIX = unix 431772Sjl139090OBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \ 441772Sjl139090 $(CORE_OBJS:%=$(OBJS_DIR)/%) \ 451772Sjl139090 $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%) 461772Sjl139090LINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 471772Sjl139090 $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 481772Sjl139090 $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \ 491772Sjl139090 $(LINTS_DIR)/vers.ln \ 501772Sjl139090 $(LINTS_DIR)/modstubs.ln 515648Ssetje 525648SsetjeKRTLD_MAPFILE = $(UTSBASE)/sparc/krtld/mapfile 535648SsetjeKRTLD_OBJECTS = $(KRTLD_OBJS:%=$(OBJS_DIR)/%) 545648SsetjeKRTLD_O = $(OBJS_DIR)/krtld.o 555648Ssetje 561772Sjl139090ROOTMODULE = $(ROOT_OPL_KERN_DIR)/$(UNIX) 571772Sjl139090UNIX_BIN = $(OBJS_DIR)/$(UNIX) 581772Sjl139090 591772Sjl139090LIBS = $(GENLIB) $(PLATLIB) $(CPULIB) 601772Sjl139090 611772Sjl139090GENUNIX = genunix 621772Sjl139090GENUNIX_DIR = ../../$(GENUNIX) 631772Sjl139090GENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX) 641772Sjl139090 651772Sjl139090CPU_DIR = . 661772Sjl139090CPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME) 671772Sjl139090 681772Sjl139090PLAT_DIR = ../../platmod 691772Sjl139090PLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD) 701772Sjl139090 711772Sjl139090LIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS) 721772Sjl139090 731772Sjl139090CTFEXTRAOBJS = $(OBJS_DIR)/vers.o 741772Sjl139090 751772Sjl139090# 761772Sjl139090# Include common rules. 771772Sjl139090# 781772Sjl139090include $(UTSBASE)/sun4u/opl/Makefile.opl 791772Sjl139090 801772Sjl139090# 811772Sjl139090# Define targets 821772Sjl139090# 831772Sjl139090ALL_TARGET = $(UNIX_BIN) 841772Sjl139090LINT_TARGET = $(LINT_LIB) 851772Sjl139090INSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE) 861772Sjl139090 871772Sjl139090# 881772Sjl139090# Overrides 891772Sjl139090# 901772Sjl139090ALL_BUILDS = $(ALL_BUILDSONLY64) 911772Sjl139090DEF_BUILDS = $(DEF_BUILDSONLY64) 921772Sjl139090SYM_BUILDS = $(DEF_BUILDSONLY64) 931772Sjl139090CLEANLINTFILES += $(LINT32_FILES) 941772Sjl139090 951772Sjl139090# 961772Sjl139090# This is UNIX_DIR. Use a short path. 971772Sjl139090# 981772Sjl139090UNIX_DIR = . 991772Sjl139090 1001772Sjl139090# 1011772Sjl139090# Overrides 1021772Sjl139090# 1035648SsetjeCLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(KRTLD_O) $(KRTLD_OBJECTS) \ 1045648Ssetje $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \ 1055648Ssetje $(CPU_OBJ) $(CPULIB) \ 1061772Sjl139090 $(DTRACESTUBS_O) $(DTRACESTUBS) 1071772Sjl139090 1081772Sjl139090CLOBBERFILES = $(CLEANFILES) $(UNIX_BIN) 1091772Sjl139090CLEANLINTFILES += $(LINT_LIB) 1101772Sjl139090 1111772Sjl139090# 1121772Sjl139090# lint pass one enforcement 1131772Sjl139090# Turn on doubleword alignment for 64 bit counter timer registers 1141772Sjl139090# 1151772Sjl139090CFLAGS += $(CCVERBOSE) -dalign 1161772Sjl139090 1171772Sjl139090# 1181772Sjl139090# Default build targets. 1191772Sjl139090# 1201772Sjl139090.KEEP_STATE: 1211772Sjl139090 1221772Sjl139090all: $(ALL_DEPS) 1231772Sjl139090 1241772Sjl139090def: $(DEF_DEPS) 1251772Sjl139090 1261772Sjl139090clean: $(CLEAN_DEPS) 1271772Sjl139090 1281772Sjl139090clobber: $(CLOBBER_DEPS) 1291772Sjl139090 1301772Sjl139090lint: $(LINT_DEPS) 1311772Sjl139090 1321772Sjl139090clean.lint: $(CLEAN_LINT_DEPS) 1331772Sjl139090 1341772Sjl139090install: $(INSTALL_DEPS) 1351772Sjl139090 1361772Sjl139090symcheck: $(SYM_DEPS) 1371772Sjl139090 1385648Ssetje$(UNIX_BIN): $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) \ 1395648Ssetje $(DTRACESTUBS) 1405648Ssetje $(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \ 1415648Ssetje $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 1421772Sjl139090 $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX) 1431772Sjl139090 $(POST_PROCESS) 1441772Sjl139090 1455648Ssetjesymcheck.targ: $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS) 1461772Sjl139090 $(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \ 1475648Ssetje $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 1481772Sjl139090 1491772Sjl139090$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o 1501772Sjl139090 $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o 1511772Sjl139090 1525648Ssetje$(KRTLD_O): $(KRTLD_OBJECTS) 1535648Ssetje $(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS) 1545648Ssetje 1551772Sjl139090# 1561772Sjl139090# CPU_OBJ now comprises of 2 object files which come from sun4 common 1571772Sjl139090# and from architecture dependent code. OBJS_DIR is prepended where 1581772Sjl139090# CPU_OBJ is defined to allow for building multiple CPU_OBJ's 1591772Sjl139090# 1601772Sjl139090$(CPULIB): $(CPU_OBJ) 1611772Sjl139090 $(LD) -o $@ -G -h 'cpu/$$CPU' $(CPU_OBJ) 1621772Sjl139090 1631772Sjl139090# 1641772Sjl139090# The global lint target builds the kernel lint library (llib-lunix.ln) 1651772Sjl139090# which is equivalent to a lint of /unix.o. Then all kernel modules for 1661772Sjl139090# this architecture are linted against the kernel lint library. 1671772Sjl139090# 1681772Sjl139090# Note: lint errors in the kernel lint library will be repeated for 1691772Sjl139090# each module. It is important that the kernel lint library 1701772Sjl139090# be clean to keep the textual output to a reasonable level. 1711772Sjl139090# 1721772Sjl139090 1731772Sjl139090$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS) 1741772Sjl139090 @-$(ECHO) "\n$(UNIX): (library construction):" 1751772Sjl139090 @$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS) 1761772Sjl139090 @$(MV) $(@F) $@ 1771772Sjl139090 1781772Sjl139090lintlib: $(LINT_DEPS) 1791772Sjl139090 1801772Sjl139090# 1811772Sjl139090# Include common targets. 1821772Sjl139090# 1831772Sjl139090include $(UTSBASE)/sun4u/opl/Makefile.targ 184