17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5fb9f9b97Skupfer# Common Development and Distribution License (the "License"). 6fb9f9b97Skupfer# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate# 227aec1d6eScindi# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate#ident "%Z%%M% %I% %E% SMI" 267c478bd9Sstevel@tonic-gate# 277c478bd9Sstevel@tonic-gate# This Makefiles contains the common targets and definitions for 287c478bd9Sstevel@tonic-gate# all kernels. It is to be included in the Makefiles for specific 297c478bd9Sstevel@tonic-gate# implementation architectures and processor architecture dependent 307c478bd9Sstevel@tonic-gate# modules: i.e.: all driving kernel Makefiles. 317c478bd9Sstevel@tonic-gate# 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate# 347c478bd9Sstevel@tonic-gate# Default rule for building the lint library directory: 357c478bd9Sstevel@tonic-gate# 367c478bd9Sstevel@tonic-gate$(LINT_LIB_DIR): 377c478bd9Sstevel@tonic-gate -@mkdir -p $@ 2> /dev/null 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate# 407c478bd9Sstevel@tonic-gate# All C objects depend on inline files. However, cc(1) doesn't generate 417c478bd9Sstevel@tonic-gate# the correct dependency info. Also, these Makefiles don't contain a 427c478bd9Sstevel@tonic-gate# separate list of C-derived object files (but it is light weight to 437c478bd9Sstevel@tonic-gate# let the assembler files think they depend upon this when they don't). 447c478bd9Sstevel@tonic-gate# Fortunately, the inline files won't change very often. So, for now, 457c478bd9Sstevel@tonic-gate# all objects depend on the inline files. Remove this when the inliner 467c478bd9Sstevel@tonic-gate# is fixed to drop correct dependency information. 477c478bd9Sstevel@tonic-gate# 487c478bd9Sstevel@tonic-gate$(OBJECTS): $(INLINES) 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate# 517c478bd9Sstevel@tonic-gate# Partially link .o files to generate the kmod. The fake dependency 527c478bd9Sstevel@tonic-gate# on modstubs simplifies things... 537c478bd9Sstevel@tonic-gate# ELFSIGN_MOD is defined in the individual KCF plug-in modules Makefiles, 547c478bd9Sstevel@tonic-gate# and will sign the ELF objects using elfsign(1). 557c478bd9Sstevel@tonic-gate# 567c478bd9Sstevel@tonic-gate$(BINARY): $(OBJECTS) 577c478bd9Sstevel@tonic-gate $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS) 587c478bd9Sstevel@tonic-gate $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX) 597c478bd9Sstevel@tonic-gate $(POST_PROCESS) 607c478bd9Sstevel@tonic-gate $(ELFSIGN_MOD) 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate# 637c478bd9Sstevel@tonic-gate# This target checks each kmod for undefined entry points. It does not 647c478bd9Sstevel@tonic-gate# modify the kmod in any way. 657c478bd9Sstevel@tonic-gate# 667c478bd9Sstevel@tonic-gate$(MODULE).check: FRC 677c478bd9Sstevel@tonic-gate @BUILD_TYPE=DBG32 $(MAKE) $(MODULE).check.targ 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate$(MODULE).check.targ: $(BINARY) $(OBJECTS) $(EXTRA_CHECK_OBJS) $(UNIX_O) $(MODSTUBS_O) $(GENLIB) 707c478bd9Sstevel@tonic-gate $(LD) -o /dev/null $(OBJECTS) $(EXTRA_CHECK_OBJS) $(UNIX_O) $(MODSTUBS_O) $(GENLIB) 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate# 737c478bd9Sstevel@tonic-gate# Module lint library construction targets. 747c478bd9Sstevel@tonic-gate# 757c478bd9Sstevel@tonic-gateMOD_LINT_LIB = $(LINT_LIB_DIR)/llib-l$(LINT_MODULE).ln 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate$(MOD_LINT_LIB): $(LINT_LIB_DIR) $(LINTS) 787c478bd9Sstevel@tonic-gate @-$(ECHO) "\n$(OBJS_DIR)/$(MODULE): (library construction):" 797c478bd9Sstevel@tonic-gate @$(LINT) -o $(LINT_MODULE) $(LINTFLAGS) $(LINTS) 807c478bd9Sstevel@tonic-gate @$(MV) $(@F) $@ 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate$(LINT_MODULE).lint: $(MOD_LINT_LIB) $(LINT_LIB) $(GEN_LINT_LIB) 837c478bd9Sstevel@tonic-gate @-$(ECHO) "\n$(OBJS_DIR)/$(LINT_MODULE): global crosschecks:" 847c478bd9Sstevel@tonic-gate @$(LINT) $(LINTFLAGS) $(MOD_LINT_LIB) $(LINT_LIB) $(GEN_LINT_LIB) 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate# 877c478bd9Sstevel@tonic-gate# Since assym.h is a derived file, the dependency must be explicit for 887c478bd9Sstevel@tonic-gate# all files including this file. (This is only actually required in the 897c478bd9Sstevel@tonic-gate# instance when the .nse_depinfo file does not exist.) It may seem that 907c478bd9Sstevel@tonic-gate# the lint targets should also have a similar dependency, but they don't 917c478bd9Sstevel@tonic-gate# since only C headers are included when #defined(lint) is true. The 927c478bd9Sstevel@tonic-gate# actual lists are defined in */Makefile.files. 937c478bd9Sstevel@tonic-gate# 947c478bd9Sstevel@tonic-gate$(ASSYM_DEPS:%=$(OBJS_DIR)/%): $(DSF_DIR)/$(OBJS_DIR)/assym.h 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate# 977c478bd9Sstevel@tonic-gate# Everybody need to know how to create a modstubs.o built with the 987c478bd9Sstevel@tonic-gate# appropriate flags and located in the appropriate location. 997c478bd9Sstevel@tonic-gate# 1007c478bd9Sstevel@tonic-gate$(MODSTUBS_O): $(MODSTUBS) 1017c478bd9Sstevel@tonic-gate $(COMPILE.s) -o $@ $(MODSTUBS) 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate$(LINTS_DIR)/modstubs.ln: $(MODSTUBS) 1047c478bd9Sstevel@tonic-gate @($(LHEAD) $(LINT.s) $(MODSTUBS) $(LTAIL)) 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate# 1077c478bd9Sstevel@tonic-gate# Build the source file which contains the kernel's utsname, 1087c478bd9Sstevel@tonic-gate# with release, version and machine set as follows: 1097c478bd9Sstevel@tonic-gate# 1107c478bd9Sstevel@tonic-gate# release: contents of $(RELEASE) (Spaces replaced by '_') 1117c478bd9Sstevel@tonic-gate# version: contents of $(PATCHID) (Spaces replaced by '_') 1127c478bd9Sstevel@tonic-gate# machine: contents of $(PLATFORM) 1137c478bd9Sstevel@tonic-gate# 1147c478bd9Sstevel@tonic-gate# Build environment information is only contained in the comment section. 1157c478bd9Sstevel@tonic-gate# 1167c478bd9Sstevel@tonic-gate# The version string, normally the variable VERSION, is set to display 1177c478bd9Sstevel@tonic-gate# environmental information temporarily while in development because 1187c478bd9Sstevel@tonic-gate# it provides a little more useful information. 1197c478bd9Sstevel@tonic-gate# 1207c478bd9Sstevel@tonic-gateVERSION_STRING = ($(ECHO) $$LOGNAME [\`basename $$CODEMGR_WS\`] \\\c; date +%D) 1217c478bd9Sstevel@tonic-gate$(INTERNAL_RELEASE_BUILD)VERSION_STRING = $(ECHO) $(PATCHID) 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate$(OBJS_DIR)/vers.o: $(OBJECTS) 1247c478bd9Sstevel@tonic-gate $(COMPILE.c) -DUTS_RELEASE=\"`$(ECHO) $(RELEASE) | sed -e 's/ /_/g'`\" \ 1257c478bd9Sstevel@tonic-gate -DUTS_VERSION=\"`$(VERSION_STRING) | sed -e 's/ /_/g'`\" \ 1267c478bd9Sstevel@tonic-gate -DUTS_PLATFORM=\"$(PLATFORM)\" -o $@ $(SRC)/uts/common/os/vers.c 1277c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 1287c478bd9Sstevel@tonic-gate $(POST_PROCESS_O) 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate$(LINTS_DIR)/vers.ln: $(SRC)/uts/common/os/vers.c 1317c478bd9Sstevel@tonic-gate @($(LHEAD) $(LINT.c) -DUTS_RELEASE=\"\" -DUTS_VERSION=\"\" \ 1327c478bd9Sstevel@tonic-gate -DUTS_PLATFORM=\"\" $(SRC)/uts/common/os/vers.c $(LTAIL)) 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate# 1357c478bd9Sstevel@tonic-gate# Installation targets and rules: 1367c478bd9Sstevel@tonic-gate# 1377c478bd9Sstevel@tonic-gate$(ROOT_MOD_DIR) $(USR_MOD_DIR): 1387c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gate$(ROOT_MOD_DIRS_32): $(ROOT_MOD_DIR) 1417c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gate$(USR_MOD_DIRS_32): $(USR_MOD_DIR) 1447c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 1457c478bd9Sstevel@tonic-gate 1467c478bd9Sstevel@tonic-gate$(ROOT_MOD_DIR)/%: $(OBJS_DIR)/% $(ROOT_MOD_DIR) FRC 1477c478bd9Sstevel@tonic-gate $(INS.file) 1487c478bd9Sstevel@tonic-gate 1497aec1d6eScindi$(ROOT_CPU_DIR)/%: $(OBJS_DIR)/% $(ROOT_CPU_DIR) FRC 1507aec1d6eScindi $(INS.file) 1517aec1d6eScindi 1527c478bd9Sstevel@tonic-gate$(ROOT_DRV_DIR)/%: $(OBJS_DIR)/% $(ROOT_DRV_DIR) FRC 1537c478bd9Sstevel@tonic-gate $(INS.file) 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate$(ROOT_DTRACE_DIR)/%: $(OBJS_DIR)/% $(ROOT_DTRACE_DIR) FRC 1567c478bd9Sstevel@tonic-gate $(INS.file) 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gate$(ROOT_EXEC_DIR)/%: $(OBJS_DIR)/% $(ROOT_EXEC_DIR) FRC 1597c478bd9Sstevel@tonic-gate $(INS.file) 1607c478bd9Sstevel@tonic-gate 1617c478bd9Sstevel@tonic-gate$(ROOT_FS_DIR)/%: $(OBJS_DIR)/% $(ROOT_FS_DIR) FRC 1627c478bd9Sstevel@tonic-gate $(INS.file) 1637c478bd9Sstevel@tonic-gate 1647c478bd9Sstevel@tonic-gate$(ROOT_SCHED_DIR)/%: $(OBJS_DIR)/% $(ROOT_SCHED_DIR) FRC 1657c478bd9Sstevel@tonic-gate $(INS.file) 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate$(ROOT_STRMOD_DIR)/%: $(OBJS_DIR)/% $(ROOT_STRMOD_DIR) FRC 1687c478bd9Sstevel@tonic-gate $(INS.file) 1697c478bd9Sstevel@tonic-gate 1707c478bd9Sstevel@tonic-gate$(ROOT_IPP_DIR)/%: $(OBJS_DIR)/% $(ROOT_IPP_DIR) FRC 1717c478bd9Sstevel@tonic-gate $(INS.file) 1727c478bd9Sstevel@tonic-gate 1737c478bd9Sstevel@tonic-gate$(ROOT_SYS_DIR)/%: $(OBJS_DIR)/% $(ROOT_SYS_DIR) FRC 1747c478bd9Sstevel@tonic-gate $(INS.file) 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gate$(ROOT_MISC_DIR)/%: $(OBJS_DIR)/% $(ROOT_MISC_DIR) FRC 1777c478bd9Sstevel@tonic-gate $(INS.file) 1787c478bd9Sstevel@tonic-gate 1797c478bd9Sstevel@tonic-gate$(ROOT_DACF_DIR)/%: $(OBJS_DIR)/% $(ROOT_DACF_DIR) FRC 1807c478bd9Sstevel@tonic-gate $(INS.file) 1817c478bd9Sstevel@tonic-gate 1827c478bd9Sstevel@tonic-gate$(ROOT_CRYPTO_DIR)/%: $(OBJS_DIR)/% $(ROOT_CRYPTO_DIR) FRC 1837c478bd9Sstevel@tonic-gate $(INS.file) 1847c478bd9Sstevel@tonic-gate 1857c478bd9Sstevel@tonic-gate$(ROOT_KGSS_DIR)/%: $(OBJS_DIR)/% $(ROOT_KGSS_DIR) FRC 1867c478bd9Sstevel@tonic-gate $(INS.file) 1877c478bd9Sstevel@tonic-gate 1887c478bd9Sstevel@tonic-gate$(ROOT_MACH_DIR)/%: $(OBJS_DIR)/% $(ROOT_MACH_DIR) FRC 1897c478bd9Sstevel@tonic-gate $(INS.file) 1907c478bd9Sstevel@tonic-gate 1917c478bd9Sstevel@tonic-gate$(ROOT_FONT_DIR)/%: $(OBJS_DIR)/% $(ROOT_MOD_DIR) $(ROOT_FONT_DIR) FRC 1927c478bd9Sstevel@tonic-gate $(INS.file) 1937c478bd9Sstevel@tonic-gate 194*ba2e4443Sseb$(ROOT_MAC_DIR)/%: $(OBJS_DIR)/% $(ROOT_MOD_DIR) $(ROOT_MAC_DIR) FRC 195*ba2e4443Sseb $(INS.file) 196*ba2e4443Sseb 1977c478bd9Sstevel@tonic-gate$(USR_DRV_DIR)/%: $(OBJS_DIR)/% $(USR_DRV_DIR) FRC 1987c478bd9Sstevel@tonic-gate $(INS.file) 1997c478bd9Sstevel@tonic-gate 2007c478bd9Sstevel@tonic-gate$(USR_EXEC_DIR)/%: $(OBJS_DIR)/% $(USR_EXEC_DIR) FRC 2017c478bd9Sstevel@tonic-gate $(INS.file) 2027c478bd9Sstevel@tonic-gate 2037c478bd9Sstevel@tonic-gate$(USR_FS_DIR)/%: $(OBJS_DIR)/% $(USR_FS_DIR) FRC 2047c478bd9Sstevel@tonic-gate $(INS.file) 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate$(USR_SCHED_DIR)/%: $(OBJS_DIR)/% $(USR_SCHED_DIR) FRC 2077c478bd9Sstevel@tonic-gate $(INS.file) 2087c478bd9Sstevel@tonic-gate 2097c478bd9Sstevel@tonic-gate$(USR_STRMOD_DIR)/%: $(OBJS_DIR)/% $(USR_STRMOD_DIR) FRC 2107c478bd9Sstevel@tonic-gate $(INS.file) 2117c478bd9Sstevel@tonic-gate 2127c478bd9Sstevel@tonic-gate$(USR_SYS_DIR)/%: $(OBJS_DIR)/% $(USR_SYS_DIR) FRC 2137c478bd9Sstevel@tonic-gate $(INS.file) 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate$(USR_MISC_DIR)/%: $(OBJS_DIR)/% $(USR_MISC_DIR) FRC 2167c478bd9Sstevel@tonic-gate $(INS.file) 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate$(USR_DACF_DIR)/%: $(OBJS_DIR)/% $(USR_DACF_DIR) FRC 2197c478bd9Sstevel@tonic-gate $(INS.file) 2207c478bd9Sstevel@tonic-gate 2217c478bd9Sstevel@tonic-gate$(USR_PCBE_DIR)/%: $(OBJS_DIR)/% $(USR_PCBE_DIR) FRC 2227c478bd9Sstevel@tonic-gate $(INS.file) 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gateinclude $(SRC)/Makefile.psm.targ 2257c478bd9Sstevel@tonic-gate 2267c478bd9Sstevel@tonic-gate# 2277c478bd9Sstevel@tonic-gate# Target for 64b modules 2287c478bd9Sstevel@tonic-gate# 2297c478bd9Sstevel@tonic-gate$(ROOT_KERN_DIR_64): 2307c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 2317c478bd9Sstevel@tonic-gate 2327c478bd9Sstevel@tonic-gate$(ROOT_KERN_DIR_64)/%: $(OBJS_DIR)/% $(ROOT_KERN_DIR_64) FRC 2337c478bd9Sstevel@tonic-gate $(INS.file) 2347c478bd9Sstevel@tonic-gate 2357c478bd9Sstevel@tonic-gate%/$(SUBDIR64): % 2367c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate# 2397c478bd9Sstevel@tonic-gate# Targets for '.conf' file installation. 2407c478bd9Sstevel@tonic-gate# 2417c478bd9Sstevel@tonic-gate$(ROOT_CONFFILE): $(SRC_CONFFILE) $(ROOT_CONFFILE:%/$(CONFFILE)=%) 2427c478bd9Sstevel@tonic-gate $(INS.conffile) 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate# 2457c478bd9Sstevel@tonic-gate# Targets for creating links between common platforms. ROOT_PLAT_LINKS 2467c478bd9Sstevel@tonic-gate# are are the /platform level while ROOT_PLAT_LINKS_2 are one level 2477c478bd9Sstevel@tonic-gate# down (/platform/`uname -i`/{lib|sbin|kernel}. 2487c478bd9Sstevel@tonic-gate# 2497c478bd9Sstevel@tonic-gate$(ROOT_PLAT_LINKS): 2507c478bd9Sstevel@tonic-gate $(INS.slink1) 2517c478bd9Sstevel@tonic-gate 2527c478bd9Sstevel@tonic-gate$(ROOT_PLAT_LINKS_2): 2537c478bd9Sstevel@tonic-gate $(INS.slink2) 2547c478bd9Sstevel@tonic-gate 2557c478bd9Sstevel@tonic-gate$(USR_PLAT_LINKS): 2567c478bd9Sstevel@tonic-gate $(INS.slink1) 2577c478bd9Sstevel@tonic-gate 2587c478bd9Sstevel@tonic-gate$(USR_PLAT_LINKS_2): 2597c478bd9Sstevel@tonic-gate $(INS.slink2) 2607c478bd9Sstevel@tonic-gate 2617c478bd9Sstevel@tonic-gate# 2627c478bd9Sstevel@tonic-gate# multiple builds support 2637c478bd9Sstevel@tonic-gate# 2647c478bd9Sstevel@tonic-gatedef $(DEF_DEPS) := TARGET = def 2657c478bd9Sstevel@tonic-gateall $(ALL_DEPS) := TARGET = all 2667c478bd9Sstevel@tonic-gateclean $(CLEAN_DEPS) := TARGET = clean 2677c478bd9Sstevel@tonic-gateclobber $(CLOBBER_DEPS) := TARGET = clobber 2687c478bd9Sstevel@tonic-gatelint $(LINT_DEPS) := TARGET = lint 2697c478bd9Sstevel@tonic-gatemodlintlib $(MODLINTLIB_DEPS) := TARGET = modlintlib 270fb9f9b97Skupfermodlist $(MODLIST_DEPS) := TARGET = modlist 271fb9f9b97Skupfermodlist $(MODLIST_DEPS) := NO_STATE= -K $$MODSTATE$$$$ 2727c478bd9Sstevel@tonic-gateclean.lint $(CLEAN_LINT_DEPS) := TARGET = clean.lint 2737c478bd9Sstevel@tonic-gateinstall $(INSTALL_DEPS) := TARGET = install 2747c478bd9Sstevel@tonic-gatesymcheck $(SYM_DEPS) := TARGET = symcheck 2757c478bd9Sstevel@tonic-gate 2767c478bd9Sstevel@tonic-gate 277fb9f9b97SkupferALL_TARGS = def all clean clobber lint modlintlib \ 278fb9f9b97Skupfer clean.lint lintlib install symcheck 2797c478bd9Sstevel@tonic-gate 2807c478bd9Sstevel@tonic-gateALL_OBJ32 = $(ALL_TARGS:%=%.obj32) 2817c478bd9Sstevel@tonic-gate 2827c478bd9Sstevel@tonic-gate$(ALL_OBJ32): FRC 283fb9f9b97Skupfer @BUILD_TYPE=OBJ32 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ 2847c478bd9Sstevel@tonic-gate 2857c478bd9Sstevel@tonic-gateALL_DEBUG32 = $(ALL_TARGS:%=%.debug32) 2867c478bd9Sstevel@tonic-gate 2877c478bd9Sstevel@tonic-gate$(ALL_DEBUG32): FRC 288fb9f9b97Skupfer @BUILD_TYPE=DBG32 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ 2897c478bd9Sstevel@tonic-gate 2907c478bd9Sstevel@tonic-gateALL_OBJ64 = $(ALL_TARGS:%=%.obj64) 2917c478bd9Sstevel@tonic-gate 2927c478bd9Sstevel@tonic-gate$(ALL_OBJ64): FRC 293fb9f9b97Skupfer @BUILD_TYPE=OBJ64 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ 2947c478bd9Sstevel@tonic-gate 2957c478bd9Sstevel@tonic-gateALL_DEBUG64 = $(ALL_TARGS:%=%.debug64) 2967c478bd9Sstevel@tonic-gate 2977c478bd9Sstevel@tonic-gate$(ALL_DEBUG64): FRC 298fb9f9b97Skupfer @BUILD_TYPE=DBG64 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ 2997c478bd9Sstevel@tonic-gate 3007c478bd9Sstevel@tonic-gate 3017c478bd9Sstevel@tonic-gate$(OBJS_DIR): 3027c478bd9Sstevel@tonic-gate -@mkdir -p $@ 2> /dev/null 3037c478bd9Sstevel@tonic-gate 3047c478bd9Sstevel@tonic-gatedef.targ: $(OBJS_DIR) $(ALL_TARGET) 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gateall.targ: $(OBJS_DIR) $(ALL_TARGET) 3077c478bd9Sstevel@tonic-gate 3087c478bd9Sstevel@tonic-gatelint.targ: $(OBJS_DIR) $(LINT_TARGET) 3097c478bd9Sstevel@tonic-gate 3107c478bd9Sstevel@tonic-gatemodlintlib.targ: $(OBJS_DIR) $(MOD_LINT_LIB) 3117c478bd9Sstevel@tonic-gate 3127c478bd9Sstevel@tonic-gateinstall.targ: $(OBJS_DIR) $(INSTALL_TARGET) 3137c478bd9Sstevel@tonic-gate 314fb9f9b97Skupfer# 315fb9f9b97Skupfer# Support for Install.sh. 316fb9f9b97Skupfer# 317fb9f9b97Skupfer 318fb9f9b97Skupfermodlist: $(MODLIST_DEPS) 319fb9f9b97Skupfer 320fb9f9b97Skupfer# paths relative to $(ROOT). 321fb9f9b97SkupferRELMODULE = $(ROOTMODULE:$(ROOT)/%=%) 322fb9f9b97SkupferRELCONF = $(ROOT_CONFFILE:$(ROOT)/%=%) 323fb9f9b97SkupferRELLINK = $(ROOTLINK:$(ROOT)/%=%) 324fb9f9b97SkupferRELUNIX = $(UNIX32_LINK:$(ROOT)/%=%) 325fb9f9b97SkupferRELSOFTLINKS = $(ROOTSOFTLINKS:$(ROOT)/%=%) 326fb9f9b97Skupfer 327fb9f9b97SkupferMODSRC:sh= pwd 328fb9f9b97Skupfer 329fb9f9b97Skupfer# 330fb9f9b97Skupfer# Changes to this target may require corresponding changes to 331fb9f9b97Skupfer# Install.sh. 332fb9f9b97Skupfer# Don't issue a MOD entry if it's not in the install list. 333fb9f9b97Skupfer# 334fb9f9b97Skupfer$(MODLIST_DEPS): FRC 335fb9f9b97Skupfer @case $@ in \ 336fb9f9b97Skupfer *32) \ 337fb9f9b97Skupfer class=32; \ 338fb9f9b97Skupfer relmodule=`dirname $(RELMODULE)`; \ 339fb9f9b97Skupfer rellink=`dirname $(RELLINK)`;; \ 340fb9f9b97Skupfer *64) \ 341fb9f9b97Skupfer class=64; \ 342fb9f9b97Skupfer relmodule=`dirname $(RELMODULE)`/$(SUBDIR64); \ 343fb9f9b97Skupfer rellink=`dirname $(RELLINK)`/$(SUBDIR64);; \ 344fb9f9b97Skupfer esac; \ 345fb9f9b97Skupfer if [ -z "$(THISIMPL)" ]; then \ 346fb9f9b97Skupfer impl=all; \ 347fb9f9b97Skupfer else \ 348fb9f9b97Skupfer impl=$(THISIMPL); \ 349fb9f9b97Skupfer fi; \ 350fb9f9b97Skupfer if [ -n "$(ROOTMODULE)" -a -n "$(INSTALL_TARGET)" ]; then \ 351fb9f9b97Skupfer if [ -z "$(MODULE)" ]; then \ 352fb9f9b97Skupfer module=`basename $(ROOTMODULE)`; \ 353fb9f9b97Skupfer else \ 354fb9f9b97Skupfer module=$(MODULE); \ 355fb9f9b97Skupfer fi; \ 356fb9f9b97Skupfer tinstall="$(INSTALL_TARGET)"; \ 357fb9f9b97Skupfer for t in $$tinstall; do \ 358fb9f9b97Skupfer if [ "$(ROOTMODULE)" = $$t ]; then \ 359fb9f9b97Skupfer echo MOD $$module $$relmodule \ 360fb9f9b97Skupfer $$class $$impl $(MODSRC); \ 361fb9f9b97Skupfer break; \ 362fb9f9b97Skupfer fi \ 363fb9f9b97Skupfer done \ 364fb9f9b97Skupfer fi; \ 365fb9f9b97Skupfer if [ -n "$(CONF_SRCDIR)" ]; then \ 366fb9f9b97Skupfer tinstall="$(INSTALL_TARGET)"; \ 367fb9f9b97Skupfer for t in $$tinstall; do \ 368fb9f9b97Skupfer if [ $(ROOT_CONFFILE) = $$t ]; then \ 369fb9f9b97Skupfer echo CONF $(RELCONF) \ 370fb9f9b97Skupfer $(MODSRC)/$(CONF_SRCDIR) $$impl $$module; \ 371fb9f9b97Skupfer break; \ 372fb9f9b97Skupfer fi \ 373fb9f9b97Skupfer done \ 374fb9f9b97Skupfer fi; \ 375fb9f9b97Skupfer if [ -n "$(ROOTLINK)" ]; then \ 376fb9f9b97Skupfer echo LINK $$relmodule $$module \ 377fb9f9b97Skupfer $$rellink `basename $(RELLINK)` $$impl; \ 378fb9f9b97Skupfer fi; \ 379fb9f9b97Skupfer if [ -n "$(UNIX32_LINK)" ]; then \ 380fb9f9b97Skupfer echo SYMLINK $(SUBDIR64)/$(UNIX) \ 381fb9f9b97Skupfer `dirname $(RELUNIX)` unix $$impl $$module; \ 382fb9f9b97Skupfer fi; \ 383fb9f9b97Skupfer trelsoftlinks="$(RELSOFTLINKS)"; \ 384fb9f9b97Skupfer for t in $$trelsoftlinks; do \ 385fb9f9b97Skupfer if [ $$class = 32 ]; then \ 386fb9f9b97Skupfer linkdir=`dirname $$t`; \ 387fb9f9b97Skupfer else \ 388fb9f9b97Skupfer linkdir=`dirname $$t`/$(SUBDIR64); \ 389fb9f9b97Skupfer fi; \ 390fb9f9b97Skupfer linkname=`basename $$t`; \ 391fb9f9b97Skupfer echo SYMLINK $(MODULE) $$linkdir $$linkname \ 392fb9f9b97Skupfer $$impl $$module; \ 393fb9f9b97Skupfer done 394fb9f9b97Skupfer 3957c478bd9Sstevel@tonic-gate# 3967c478bd9Sstevel@tonic-gate# Cleanliness is next to ... 3977c478bd9Sstevel@tonic-gate# 3987c478bd9Sstevel@tonic-gateclean.targ: 3997c478bd9Sstevel@tonic-gate -$(RM) $(CLEANFILES) Nothing_to_remove 4007c478bd9Sstevel@tonic-gate 4017c478bd9Sstevel@tonic-gateclobber.targ: 4027c478bd9Sstevel@tonic-gate -$(RM) $(CLOBBERFILES) Nothing_to_remove 4037c478bd9Sstevel@tonic-gate 4047c478bd9Sstevel@tonic-gateclean.lint.targ: 4057c478bd9Sstevel@tonic-gate -$(RM) $(CLEANLINTFILES) Nothing_to_remove 4067c478bd9Sstevel@tonic-gate 4077c478bd9Sstevel@tonic-gate# 4087c478bd9Sstevel@tonic-gate# Create fake lintlibs in the 64b dirs so 4097c478bd9Sstevel@tonic-gate# global linting works 4107c478bd9Sstevel@tonic-gate# 4117c478bd9Sstevel@tonic-gatelint64: 4127c478bd9Sstevel@tonic-gate @$(ECHO) $(MODULE) fake lints 4137c478bd9Sstevel@tonic-gate @for dir in $(LINT64_DIRS); do \ 4147c478bd9Sstevel@tonic-gate if [ ! -d $$dir ]; then mkdir $$dir; fi \ 4157c478bd9Sstevel@tonic-gate done 4167c478bd9Sstevel@tonic-gate @for file in $(LINT64_FILES); do \ 4177c478bd9Sstevel@tonic-gate if [ ! -f $$file ]; then touch $$file; fi \ 4187c478bd9Sstevel@tonic-gate done 4197c478bd9Sstevel@tonic-gate 4207c478bd9Sstevel@tonic-gate# 4217c478bd9Sstevel@tonic-gate# In some places we also need to create fake lintlibs for 32b 4227c478bd9Sstevel@tonic-gate# dirs so global linting works 4237c478bd9Sstevel@tonic-gate# 4247c478bd9Sstevel@tonic-gatelint32: 4257c478bd9Sstevel@tonic-gate @$(ECHO) $(MODULE) fake lints 4267c478bd9Sstevel@tonic-gate @for dir in $(LINT32_DIRS); do \ 4277c478bd9Sstevel@tonic-gate if [ ! -d $$dir ]; then mkdir $$dir; fi \ 4287c478bd9Sstevel@tonic-gate done 4297c478bd9Sstevel@tonic-gate @for file in $(LINT32_FILES); do \ 4307c478bd9Sstevel@tonic-gate if [ ! -f $$file ]; then touch $$file; fi \ 4317c478bd9Sstevel@tonic-gate done 4327c478bd9Sstevel@tonic-gateFRC: 433