xref: /illumos-gate/usr/src/uts/Makefile.targ (revision 0aaef2f5)
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#
2284d8c05bSMike Kupfer# Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
23cd277642SGarrett D'Amore# Copyright 2014 Garrett D'Amore <garrett@damore.org>
24f73e0305SHans Rosenfeld# Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
2545a4b79dSSebastien Roy# Copyright (c) 2017 by Delphix. All rights reserved.
264c87aefeSPatrick Mooney# Copyright 2019 Joyent, Inc.
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate#	This Makefiles contains the common targets and definitions for
297c478bd9Sstevel@tonic-gate#	all kernels. It is to be included in the Makefiles for specific
307c478bd9Sstevel@tonic-gate#	implementation architectures and processor architecture dependent
317c478bd9Sstevel@tonic-gate#	modules: i.e.: all driving kernel Makefiles.
327c478bd9Sstevel@tonic-gate#
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate#
357c478bd9Sstevel@tonic-gate#	All C objects depend on inline files. However, cc(1) doesn't generate
367c478bd9Sstevel@tonic-gate#	the correct dependency info. Also, these Makefiles don't contain a
377c478bd9Sstevel@tonic-gate#	separate list of C-derived object files (but it is light weight to
387c478bd9Sstevel@tonic-gate#	let the assembler files think they depend upon this when they don't).
397c478bd9Sstevel@tonic-gate#	Fortunately, the inline files won't change very often. So, for now,
407c478bd9Sstevel@tonic-gate#	all objects depend on the inline files. Remove this when the inliner
417c478bd9Sstevel@tonic-gate#	is fixed to drop correct dependency information.
427c478bd9Sstevel@tonic-gate#
437c478bd9Sstevel@tonic-gate$(OBJECTS): $(INLINES)
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gate#
467c478bd9Sstevel@tonic-gate#	Partially link .o files to generate the kmod. The fake dependency
477c478bd9Sstevel@tonic-gate#	on modstubs simplifies things...
487c478bd9Sstevel@tonic-gate#
494c87aefeSPatrick Mooney$(BINARY):		$(OBJECTS) $(DTRACE_MAPFILE) $(MAPFILE)
507c478bd9Sstevel@tonic-gate	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
517c478bd9Sstevel@tonic-gate	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
527c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate#
557c478bd9Sstevel@tonic-gate#	This target checks each kmod for undefined entry points. It does not
567c478bd9Sstevel@tonic-gate#	modify the kmod in any way.
577c478bd9Sstevel@tonic-gate#
587c478bd9Sstevel@tonic-gate$(MODULE).check:	FRC
597c478bd9Sstevel@tonic-gate	@BUILD_TYPE=DBG32 $(MAKE) $(MODULE).check.targ
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate$(MODULE).check.targ:	$(BINARY) $(OBJECTS) $(EXTRA_CHECK_OBJS) $(UNIX_O) $(MODSTUBS_O) $(GENLIB)
627c478bd9Sstevel@tonic-gate	$(LD) -o /dev/null $(OBJECTS) $(EXTRA_CHECK_OBJS) $(UNIX_O) $(MODSTUBS_O) $(GENLIB)
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate#
65*0aaef2f5SRichard Lowe# Since assym.h is a derived file, the dependency must be explicit for all
66*0aaef2f5SRichard Lowe# files including this file.  The actual lists are defined in
67*0aaef2f5SRichard Lowe# */Makefile.files.
687c478bd9Sstevel@tonic-gate#
697c478bd9Sstevel@tonic-gate$(ASSYM_DEPS:%=$(OBJS_DIR)/%):	$(DSF_DIR)/$(OBJS_DIR)/assym.h
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gate#
727c478bd9Sstevel@tonic-gate#	Everybody need to know how to create a modstubs.o built with the
737c478bd9Sstevel@tonic-gate#	appropriate flags and located in the appropriate location.
747c478bd9Sstevel@tonic-gate#
757c478bd9Sstevel@tonic-gate$(MODSTUBS_O):	$(MODSTUBS)
767c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $(MODSTUBS)
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gate#
797c478bd9Sstevel@tonic-gate# Build the source file which contains the kernel's utsname,
807c478bd9Sstevel@tonic-gate# with release, version and machine set as follows:
817c478bd9Sstevel@tonic-gate#
827c478bd9Sstevel@tonic-gate#	release: contents of $(RELEASE) (Spaces replaced by '_')
837c478bd9Sstevel@tonic-gate#	version: contents of $(PATCHID) (Spaces replaced by '_')
84ae115bc7Smrj#	machine: contents of $(UNAME_M)
857c478bd9Sstevel@tonic-gate#
867c478bd9Sstevel@tonic-gate# Build environment information is only contained in the comment section.
877c478bd9Sstevel@tonic-gate#
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gate$(OBJS_DIR)/vers.o: $(OBJECTS)
907c478bd9Sstevel@tonic-gate	$(COMPILE.c) -DUTS_RELEASE=\"`$(ECHO) $(RELEASE) | sed -e 's/ /_/g'`\" \
9134ae5cdfSJosef 'Jeff' Sipek	    -DUTS_VERSION=\"`$(ECHO) $(PATCHID) | sed -e 's/ /_/g'`\" \
92ae115bc7Smrj	    -DUTS_PLATFORM=\"$(UNAME_M)\" -o $@ $(SRC)/uts/common/os/vers.c
937c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
947c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gate#
977c478bd9Sstevel@tonic-gate#	Installation targets and rules:
987c478bd9Sstevel@tonic-gate#
997c478bd9Sstevel@tonic-gate$(ROOT_MOD_DIR) $(USR_MOD_DIR):
10048bc00d6Sjmcp	-$(INS.dir)
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gate$(ROOT_MOD_DIRS_32):	$(ROOT_MOD_DIR)
10348bc00d6Sjmcp	-$(INS.dir)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gate$(USR_MOD_DIRS_32):	$(USR_MOD_DIR)
10648bc00d6Sjmcp	-$(INS.dir)
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gate$(ROOT_MOD_DIR)/%:	$(OBJS_DIR)/% $(ROOT_MOD_DIR) FRC
1097c478bd9Sstevel@tonic-gate	$(INS.file)
1107c478bd9Sstevel@tonic-gate
1117aec1d6eScindi$(ROOT_CPU_DIR)/%:	$(OBJS_DIR)/% $(ROOT_CPU_DIR) FRC
1127aec1d6eScindi	$(INS.file)
1137aec1d6eScindi
1147c478bd9Sstevel@tonic-gate$(ROOT_DRV_DIR)/%:	$(OBJS_DIR)/% $(ROOT_DRV_DIR) FRC
1157c478bd9Sstevel@tonic-gate	$(INS.file)
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gate$(ROOT_DTRACE_DIR)/%:	$(OBJS_DIR)/% $(ROOT_DTRACE_DIR) FRC
1187c478bd9Sstevel@tonic-gate	$(INS.file)
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate$(ROOT_EXEC_DIR)/%:	$(OBJS_DIR)/% $(ROOT_EXEC_DIR) FRC
1217c478bd9Sstevel@tonic-gate	$(INS.file)
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate$(ROOT_FS_DIR)/%:	$(OBJS_DIR)/% $(ROOT_FS_DIR) FRC
1247c478bd9Sstevel@tonic-gate	$(INS.file)
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate$(ROOT_SCHED_DIR)/%:	$(OBJS_DIR)/% $(ROOT_SCHED_DIR) FRC
1277c478bd9Sstevel@tonic-gate	$(INS.file)
1287c478bd9Sstevel@tonic-gate
1290f1702c5SYu Xiangning$(ROOT_SOCK_DIR)/%:	$(OBJS_DIR)/% $(ROOT_SOCK_DIR) FRC
1300f1702c5SYu Xiangning	$(INS.file)
1310f1702c5SYu Xiangning
1327c478bd9Sstevel@tonic-gate$(ROOT_STRMOD_DIR)/%:	$(OBJS_DIR)/% $(ROOT_STRMOD_DIR) FRC
1337c478bd9Sstevel@tonic-gate	$(INS.file)
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gate$(ROOT_IPP_DIR)/%:	$(OBJS_DIR)/% $(ROOT_IPP_DIR) FRC
1367c478bd9Sstevel@tonic-gate	$(INS.file)
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gate$(ROOT_SYS_DIR)/%:	$(OBJS_DIR)/% $(ROOT_SYS_DIR) FRC
1397c478bd9Sstevel@tonic-gate	$(INS.file)
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gate$(ROOT_MISC_DIR)/%:	$(OBJS_DIR)/% $(ROOT_MISC_DIR) FRC
1427c478bd9Sstevel@tonic-gate	$(INS.file)
1437c478bd9Sstevel@tonic-gate
1447c478bd9Sstevel@tonic-gate$(ROOT_DACF_DIR)/%:	$(OBJS_DIR)/% $(ROOT_DACF_DIR) FRC
1457c478bd9Sstevel@tonic-gate	$(INS.file)
1467c478bd9Sstevel@tonic-gate
1479acbbeafSnn$(ROOT_BRAND_DIR)/%:	$(OBJS_DIR)/% $(ROOT_BRAND_DIR) FRC
1489acbbeafSnn	$(INS.file)
1499acbbeafSnn
15045a4b79dSSebastien Roy$(ROOT_CC_DIR)/%:	$(OBJS_DIR)/% $(ROOT_MOD_DIR) $(ROOT_CC_DIR) FRC
15145a4b79dSSebastien Roy	$(INS.file)
15245a4b79dSSebastien Roy
1537c478bd9Sstevel@tonic-gate$(ROOT_CRYPTO_DIR)/%:	$(OBJS_DIR)/% $(ROOT_CRYPTO_DIR) FRC
1547c478bd9Sstevel@tonic-gate	$(INS.file)
1557c478bd9Sstevel@tonic-gate
1567c478bd9Sstevel@tonic-gate$(ROOT_KGSS_DIR)/%:	$(OBJS_DIR)/% $(ROOT_KGSS_DIR) FRC
1577c478bd9Sstevel@tonic-gate	$(INS.file)
1587c478bd9Sstevel@tonic-gate
1591e1ddd6cScth$(ROOT_SCSI_VHCI_DIR)/%: $(OBJS_DIR)/% $(ROOT_SCSI_VHCI_DIR) FRC
1601e1ddd6cScth	$(INS.file)
1611e1ddd6cScth
1624c06356bSdh$(ROOT_PMCS_FW_DIR)/%:	$(OBJS_DIR)/% $(ROOT_PMCS_FW_DIR) FRC
1634c06356bSdh	$(INS.file)
1644c06356bSdh
165fcf3ce44SJohn Forte$(ROOT_QLC_FW_DIR)/%:	$(OBJS_DIR)/% $(ROOT_QLC_FW_DIR) FRC
166fcf3ce44SJohn Forte	$(INS.file)
167fcf3ce44SJohn Forte
168291a2b48SSukumar Swaminathan$(ROOT_EMLXS_FW_DIR)/%:	$(OBJS_DIR)/% $(ROOT_EMLXS_FW_DIR) FRC
169291a2b48SSukumar Swaminathan	$(INS.file)
170291a2b48SSukumar Swaminathan
1717c478bd9Sstevel@tonic-gate$(ROOT_MACH_DIR)/%:	$(OBJS_DIR)/% $(ROOT_MACH_DIR) FRC
1727c478bd9Sstevel@tonic-gate	$(INS.file)
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gate$(ROOT_FONT_DIR)/%:	$(OBJS_DIR)/% $(ROOT_MOD_DIR) $(ROOT_FONT_DIR) FRC
1757c478bd9Sstevel@tonic-gate	$(INS.file)
1767c478bd9Sstevel@tonic-gate
177ba2e4443Sseb$(ROOT_MAC_DIR)/%:	$(OBJS_DIR)/% $(ROOT_MOD_DIR) $(ROOT_MAC_DIR) FRC
178ba2e4443Sseb	$(INS.file)
179ba2e4443Sseb
1807c478bd9Sstevel@tonic-gate$(USR_DRV_DIR)/%:	$(OBJS_DIR)/% $(USR_DRV_DIR) FRC
1817c478bd9Sstevel@tonic-gate	$(INS.file)
1827c478bd9Sstevel@tonic-gate
1837c478bd9Sstevel@tonic-gate$(USR_EXEC_DIR)/%:	$(OBJS_DIR)/% $(USR_EXEC_DIR) FRC
1847c478bd9Sstevel@tonic-gate	$(INS.file)
1857c478bd9Sstevel@tonic-gate
1867c478bd9Sstevel@tonic-gate$(USR_FS_DIR)/%:	$(OBJS_DIR)/% $(USR_FS_DIR) FRC
1877c478bd9Sstevel@tonic-gate	$(INS.file)
1887c478bd9Sstevel@tonic-gate
1897c478bd9Sstevel@tonic-gate$(USR_SCHED_DIR)/%:	$(OBJS_DIR)/% $(USR_SCHED_DIR) FRC
1907c478bd9Sstevel@tonic-gate	$(INS.file)
1917c478bd9Sstevel@tonic-gate
1920a0e9771SDarren Reed$(USR_SOCK_DIR)/%:	$(OBJS_DIR)/% $(USR_SOCK_DIR) FRC
1930a0e9771SDarren Reed	$(INS.file)
1940a0e9771SDarren Reed
1957c478bd9Sstevel@tonic-gate$(USR_STRMOD_DIR)/%:	$(OBJS_DIR)/% $(USR_STRMOD_DIR) FRC
1967c478bd9Sstevel@tonic-gate	$(INS.file)
1977c478bd9Sstevel@tonic-gate
1987c478bd9Sstevel@tonic-gate$(USR_SYS_DIR)/%:	$(OBJS_DIR)/% $(USR_SYS_DIR) FRC
1997c478bd9Sstevel@tonic-gate	$(INS.file)
2007c478bd9Sstevel@tonic-gate
2017c478bd9Sstevel@tonic-gate$(USR_MISC_DIR)/%:	$(OBJS_DIR)/% $(USR_MISC_DIR) FRC
2027c478bd9Sstevel@tonic-gate	$(INS.file)
2037c478bd9Sstevel@tonic-gate
2047c478bd9Sstevel@tonic-gate$(USR_DACF_DIR)/%:	$(OBJS_DIR)/% $(USR_DACF_DIR) FRC
2057c478bd9Sstevel@tonic-gate	$(INS.file)
2067c478bd9Sstevel@tonic-gate
2077c478bd9Sstevel@tonic-gate$(USR_PCBE_DIR)/%:	$(OBJS_DIR)/% $(USR_PCBE_DIR) FRC
2087c478bd9Sstevel@tonic-gate	$(INS.file)
2097c478bd9Sstevel@tonic-gate
2109a9ae70fSjv$(USR_DTRACE_DIR)/%:	$(OBJS_DIR)/% $(USR_DTRACE_DIR) FRC
2119a9ae70fSjv	$(INS.file)
2129a9ae70fSjv
2139a9ae70fSjv$(USR_BRAND_DIR)/%:	$(OBJS_DIR)/% $(USR_BRAND_DIR) FRC
2149a9ae70fSjv	$(INS.file)
2159a9ae70fSjv
216d14d7d31Sis$(ROOT_KICONV_DIR)/%:	$(OBJS_DIR)/% $(ROOT_KICONV_DIR) FRC
217d14d7d31Sis	$(INS.file)
218d14d7d31Sis
219f73e0305SHans Rosenfeld$(ROOT_FIRMWARE_DIR)/$(MODULE):
220f73e0305SHans Rosenfeld	$(INS.dir)
221f73e0305SHans Rosenfeld
222f73e0305SHans Rosenfeld$(ROOT_FIRMWARE_DIR)/$(MODULE)/%:= FILEMODE = $(CFILEMODE)
223f73e0305SHans Rosenfeld
224f73e0305SHans Rosenfeld$(ROOT_FIRMWARE_DIR)/$(MODULE)/%: $(ROOT_FIRMWARE_DIR)/$(MODULE) $(FWDIR)/%
225f73e0305SHans Rosenfeld	$(INS.file)
226f73e0305SHans Rosenfeld
2277c478bd9Sstevel@tonic-gateinclude $(SRC)/Makefile.psm.targ
2287c478bd9Sstevel@tonic-gate
2297c478bd9Sstevel@tonic-gate#
2307c478bd9Sstevel@tonic-gate#	Target for 64b modules
2317c478bd9Sstevel@tonic-gate#
2327c478bd9Sstevel@tonic-gate$(ROOT_KERN_DIR_64):
23348bc00d6Sjmcp	-$(INS.dir)
2347c478bd9Sstevel@tonic-gate
2357c478bd9Sstevel@tonic-gate$(ROOT_KERN_DIR_64)/%:	$(OBJS_DIR)/% $(ROOT_KERN_DIR_64) FRC
2367c478bd9Sstevel@tonic-gate	$(INS.file)
2377c478bd9Sstevel@tonic-gate
2387c478bd9Sstevel@tonic-gate%/$(SUBDIR64):		%
23948bc00d6Sjmcp	-$(INS.dir)
2407c478bd9Sstevel@tonic-gate
2417c478bd9Sstevel@tonic-gate#
2427c478bd9Sstevel@tonic-gate#	Targets for '.conf' file installation.
2437c478bd9Sstevel@tonic-gate#
2447c478bd9Sstevel@tonic-gate$(ROOT_CONFFILE):	$(SRC_CONFFILE)	$(ROOT_CONFFILE:%/$(CONFFILE)=%)
2457c478bd9Sstevel@tonic-gate	$(INS.conffile)
2467c478bd9Sstevel@tonic-gate
2477c478bd9Sstevel@tonic-gate#
2487c478bd9Sstevel@tonic-gate#	Targets for creating links between common platforms. ROOT_PLAT_LINKS
2497c478bd9Sstevel@tonic-gate#	are are the /platform level while ROOT_PLAT_LINKS_2 are one level
2507c478bd9Sstevel@tonic-gate#	down (/platform/`uname -i`/{lib|sbin|kernel}.
2517c478bd9Sstevel@tonic-gate#
2527c478bd9Sstevel@tonic-gate$(ROOT_PLAT_LINKS):
2537c478bd9Sstevel@tonic-gate	$(INS.slink1)
2547c478bd9Sstevel@tonic-gate
2557c478bd9Sstevel@tonic-gate$(ROOT_PLAT_LINKS_2):
2567c478bd9Sstevel@tonic-gate	$(INS.slink2)
2577c478bd9Sstevel@tonic-gate
2587c478bd9Sstevel@tonic-gate$(USR_PLAT_LINKS):
2597c478bd9Sstevel@tonic-gate	$(INS.slink1)
2607c478bd9Sstevel@tonic-gate
2617c478bd9Sstevel@tonic-gate$(USR_PLAT_LINKS_2):
2627c478bd9Sstevel@tonic-gate	$(INS.slink2)
2637c478bd9Sstevel@tonic-gate
2647c478bd9Sstevel@tonic-gate#
2657c478bd9Sstevel@tonic-gate# multiple builds support
2667c478bd9Sstevel@tonic-gate#
2677c478bd9Sstevel@tonic-gatedef $(DEF_DEPS)			:= TARGET = def
2687c478bd9Sstevel@tonic-gateall $(ALL_DEPS)			:= TARGET = all
2697c478bd9Sstevel@tonic-gateclean $(CLEAN_DEPS)		:= TARGET = clean
2707c478bd9Sstevel@tonic-gateclobber $(CLOBBER_DEPS)		:= TARGET = clobber
271fb9f9b97Skupfermodlist	$(MODLIST_DEPS)		:= TARGET = modlist
272fb9f9b97Skupfermodlist	$(MODLIST_DEPS)		:= NO_STATE= -K $$MODSTATE$$$$
2737c478bd9Sstevel@tonic-gateinstall $(INSTALL_DEPS)		:= TARGET = install
2747c478bd9Sstevel@tonic-gatesymcheck $(SYM_DEPS)		:= TARGET = symcheck
2757c478bd9Sstevel@tonic-gate
276*0aaef2f5SRichard LoweALL_TARGS	= def all clean clobber install symcheck
2777c478bd9Sstevel@tonic-gate
278bbbed746SGordon RossALL_OBJ32	= $(ALL_TARGS:%=%.obj32)
279bbbed746SGordon Ross
280bbbed746SGordon Ross$(ALL_OBJ32):	FRC
281bbbed746SGordon Ross	@BUILD_TYPE=OBJ32 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ
282bbbed746SGordon Ross
283bbbed746SGordon RossALL_DEBUG32	= $(ALL_TARGS:%=%.debug32)
284bbbed746SGordon Ross
285bbbed746SGordon Ross$(ALL_DEBUG32):	FRC
286bbbed746SGordon Ross	@BUILD_TYPE=DBG32 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ
287bbbed746SGordon Ross
2887c478bd9Sstevel@tonic-gateALL_OBJ64	= $(ALL_TARGS:%=%.obj64)
2897c478bd9Sstevel@tonic-gate
2907c478bd9Sstevel@tonic-gate$(ALL_OBJ64):	FRC
291fb9f9b97Skupfer	@BUILD_TYPE=OBJ64 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ
2927c478bd9Sstevel@tonic-gate
2937c478bd9Sstevel@tonic-gateALL_DEBUG64	= $(ALL_TARGS:%=%.debug64)
2947c478bd9Sstevel@tonic-gate
2957c478bd9Sstevel@tonic-gate$(ALL_DEBUG64):	FRC
296fb9f9b97Skupfer	@BUILD_TYPE=DBG64 VERSION='$(VERSION)' $(MAKE) $(NO_STATE) $(TARGET).targ
2977c478bd9Sstevel@tonic-gate
298112f9fc1Syz#
299112f9fc1Syz#	Currently only the IP module needs symbol checking on obj64.
300112f9fc1Syz#	Other modules have the same global-objs nm output for debug64 and obj64.
301112f9fc1Syz#
302112f9fc1Syz$(SISCHECK_DEPS):	$(DEF_DEPS)
303112f9fc1Syz	@TARG=`$(ECHO) $@ | $(CUT) -d'.' -f2`; \
304112f9fc1Syz	MODSYMS=$(MODULE).symbols.$$TARG; \
305112f9fc1Syz	if [ -f "$(MODULE).global-objs.$$TARG" ]; then \
306112f9fc1Syz		$(GREP) -v '#' $(MODULE).global-objs.$$TARG |$(GREP) . | \
307112f9fc1Syz		    $(SORT) -u > $$MODSYMS.tmp; \
308112f9fc1Syz		$(NM) $$TARG/$(MODULE) |$(GREP) OBJT |$(GREP) -v UNDEF | \
309756e192dSyz		    $(CUT) -d'|' -f8 |$(GREP) -v '^___const_' | \
310756e192dSyz		    $(GREP) -v '\.[0-9]*$$' |$(SORT) -u \
311112f9fc1Syz		    > $$MODSYMS.tmp.new; \
312112f9fc1Syz		$(DIFF) $$MODSYMS.tmp $$MODSYMS.tmp.new > $$MODSYMS.diff || \
313112f9fc1Syz		    ($(ECHO) "warning: $(MODULE) symbol checking:" \
314112f9fc1Syz		    "global variable(s) introduced and/or removed."; \
315112f9fc1Syz		    $(CAT) $$MODSYMS.diff; exit 1) \
316112f9fc1Syz	fi
317112f9fc1Syz
318112f9fc1Syz$(SISCLEAN_DEPS):
319112f9fc1Syz	-TARG=`$(ECHO) $@ | $(CUT) -d'.' -f2`; \
320112f9fc1Syz	MODSYMS=$(MODULE).symbols.$$TARG; \
321112f9fc1Syz	$(RM) $$MODSYMS.tmp $$MODSYMS.tmp.new $$MODSYMS.diff Nothing_to_remove
322112f9fc1Syz
3237c478bd9Sstevel@tonic-gate
3247c478bd9Sstevel@tonic-gate$(OBJS_DIR):
3257c478bd9Sstevel@tonic-gate	-@mkdir -p $@ 2> /dev/null
3267c478bd9Sstevel@tonic-gate
3277c478bd9Sstevel@tonic-gatedef.targ:		$(OBJS_DIR) $(ALL_TARGET)
3287c478bd9Sstevel@tonic-gate
3297c478bd9Sstevel@tonic-gateall.targ:		$(OBJS_DIR) $(ALL_TARGET)
3307c478bd9Sstevel@tonic-gate
3317c478bd9Sstevel@tonic-gateinstall.targ:		$(OBJS_DIR) $(INSTALL_TARGET)
3327c478bd9Sstevel@tonic-gate
333fb9f9b97Skupfer#
334fb9f9b97Skupfer# Support for Install.sh.
335fb9f9b97Skupfer#
336fb9f9b97Skupfer
337fb9f9b97Skupfermodlist:	$(MODLIST_DEPS)
338fb9f9b97Skupfer
339fb9f9b97Skupfer# paths relative to $(ROOT).
340fb9f9b97SkupferRELMODULE = $(ROOTMODULE:$(ROOT)/%=%)
341fb9f9b97SkupferRELCONF = $(ROOT_CONFFILE:$(ROOT)/%=%)
342fb9f9b97SkupferRELLINK = $(ROOTLINK:$(ROOT)/%=%)
343fb9f9b97SkupferRELUNIX = $(UNIX32_LINK:$(ROOT)/%=%)
344fb9f9b97SkupferRELSOFTLINKS = $(ROOTSOFTLINKS:$(ROOT)/%=%)
345fb9f9b97Skupfer
346fb9f9b97SkupferMODSRC:sh=		pwd
347fb9f9b97Skupfer
34884d8c05bSMike Kupfer#
34984d8c05bSMike Kupfer# Generate module information for Install.sh, i.e., specify what files
35084d8c05bSMike Kupfer# Install.sh should include.  Each line looks like
35184d8c05bSMike Kupfer#   <tag> <srcdir> <arg1> <arg2> ...
35284d8c05bSMike Kupfer# where <tag> specifies the type of file, <srcdir> gives the source
35384d8c05bSMike Kupfer# path (useful if there is an error), and <argN> is one or more
35484d8c05bSMike Kupfer# additional bits of information that Install.sh needs (e.g., source
35584d8c05bSMike Kupfer# directory, install directory, filtering tags).  See Install.sh for
35684d8c05bSMike Kupfer# details on the arguments for each tag type, especially the functions
35784d8c05bSMike Kupfer# copymod, filtmod, and filtimpl.
358fb9f9b97Skupfer#
359fb9f9b97Skupfer# Changes to this target may require corresponding changes to
360fb9f9b97Skupfer# Install.sh.
36184d8c05bSMike Kupfer#
362fb9f9b97Skupfer# Don't issue a MOD entry if it's not in the install list.
363fb9f9b97Skupfer#
36484d8c05bSMike Kupfer
365fb9f9b97Skupfer$(MODLIST_DEPS): FRC
366fb9f9b97Skupfer	@case $@ in \
367fb9f9b97Skupfer	*32) \
368fb9f9b97Skupfer		class=32; \
36984d8c05bSMike Kupfer		[ -n "$(RELMODULE)" ] && relmodule=`dirname $(RELMODULE)`;; \
370fb9f9b97Skupfer	*64) \
371fb9f9b97Skupfer		class=64; \
37284d8c05bSMike Kupfer		[ -n "$(RELMODULE)" ] && \
37384d8c05bSMike Kupfer		    relmodule=`dirname $(RELMODULE)`/$(SUBDIR64);; \
374fb9f9b97Skupfer	esac; \
375fb9f9b97Skupfer	if [ -z "$(THISIMPL)" ]; then \
376fb9f9b97Skupfer		impl=all; \
377fb9f9b97Skupfer	else \
378fb9f9b97Skupfer		impl=$(THISIMPL); \
379fb9f9b97Skupfer	fi; \
380fb9f9b97Skupfer	if [ -n "$(ROOTMODULE)" -a -n "$(INSTALL_TARGET)" ]; then \
381fb9f9b97Skupfer		if [ -z "$(MODULE)" ]; then \
382fb9f9b97Skupfer			module=`basename $(ROOTMODULE)`; \
383fb9f9b97Skupfer		else \
384fb9f9b97Skupfer			module=$(MODULE); \
385fb9f9b97Skupfer		fi; \
386fb9f9b97Skupfer		tinstall="$(INSTALL_TARGET)"; \
387fb9f9b97Skupfer		for t in $$tinstall; do \
388fb9f9b97Skupfer			if [ "$(ROOTMODULE)" = $$t ]; then \
38984d8c05bSMike Kupfer				echo MOD $(MODSRC) $$module $$relmodule \
39084d8c05bSMike Kupfer				    $$class $$impl; \
391fb9f9b97Skupfer				break; \
392fb9f9b97Skupfer			fi \
393fb9f9b97Skupfer		done \
394fb9f9b97Skupfer	fi; \
395fb9f9b97Skupfer	if [ -n "$(CONF_SRCDIR)" ]; then \
396fb9f9b97Skupfer		tinstall="$(INSTALL_TARGET)"; \
397fb9f9b97Skupfer		for t in $$tinstall; do \
398fb9f9b97Skupfer			if [ $(ROOT_CONFFILE) = $$t ]; then \
39984d8c05bSMike Kupfer				echo CONF $(MODSRC) $(RELCONF) \
400fb9f9b97Skupfer				    $(MODSRC)/$(CONF_SRCDIR) $$impl $$module; \
401fb9f9b97Skupfer				break; \
402fb9f9b97Skupfer			fi \
403fb9f9b97Skupfer		done \
404fb9f9b97Skupfer	fi; \
405fb9f9b97Skupfer	if [ -n "$(ROOTLINK)" ]; then \
4060f1702c5SYu Xiangning		rellinks="$(RELLINK)"; \
4070f1702c5SYu Xiangning		for r in $$rellinks; do \
40884d8c05bSMike Kupfer			if [ $$class = 32 ]; then \
40984d8c05bSMike Kupfer				linkdir=`dirname $$r`; \
41084d8c05bSMike Kupfer			else \
41184d8c05bSMike Kupfer				linkdir=`dirname $$r`/$(SUBDIR64); \
41284d8c05bSMike Kupfer			fi; \
41384d8c05bSMike Kupfer			echo LINK $(MODSRC) $$relmodule $$module \
41484d8c05bSMike Kupfer				$$linkdir `basename $$r` $$impl; \
4150f1702c5SYu Xiangning		done \
416fb9f9b97Skupfer	fi; \
417fb9f9b97Skupfer	if [ -n "$(UNIX32_LINK)" ]; then \
41884d8c05bSMike Kupfer		echo SYMLINK $(MODSRC) $(SUBDIR64)/$(UNIX) \
419fb9f9b97Skupfer		    `dirname $(RELUNIX)` unix $$impl $$module; \
420fb9f9b97Skupfer	fi; \
421fb9f9b97Skupfer	trelsoftlinks="$(RELSOFTLINKS)"; \
422fb9f9b97Skupfer	for t in $$trelsoftlinks; do \
423fb9f9b97Skupfer		if [ $$class = 32 ]; then \
424fb9f9b97Skupfer			linkdir=`dirname $$t`; \
425fb9f9b97Skupfer		else \
426fb9f9b97Skupfer			linkdir=`dirname $$t`/$(SUBDIR64); \
427fb9f9b97Skupfer		fi; \
428fb9f9b97Skupfer		linkname=`basename $$t`; \
42984d8c05bSMike Kupfer		echo SYMLINK $(MODSRC) $(MODULE) $$linkdir $$linkname \
430fb9f9b97Skupfer		    $$impl $$module; \
431fb9f9b97Skupfer	done
432fb9f9b97Skupfer
4337c478bd9Sstevel@tonic-gate#
4347c478bd9Sstevel@tonic-gate#	Cleanliness is next to ...
4357c478bd9Sstevel@tonic-gate#
4367c478bd9Sstevel@tonic-gateclean.targ:
4377c478bd9Sstevel@tonic-gate	-$(RM) $(CLEANFILES) Nothing_to_remove
4387c478bd9Sstevel@tonic-gate
4397c478bd9Sstevel@tonic-gateclobber.targ:
4407c478bd9Sstevel@tonic-gate	-$(RM) $(CLOBBERFILES) Nothing_to_remove
4417c478bd9Sstevel@tonic-gate
4427c478bd9Sstevel@tonic-gateFRC:
443