xref: /titanic_50/usr/src/uts/sun4u/opl/unix/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
125cf1a30Sjl139090#
225cf1a30Sjl139090# CDDL HEADER START
325cf1a30Sjl139090#
425cf1a30Sjl139090# The contents of this file are subject to the terms of the
525cf1a30Sjl139090# Common Development and Distribution License (the "License").
625cf1a30Sjl139090# You may not use this file except in compliance with the License.
725cf1a30Sjl139090#
825cf1a30Sjl139090# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
925cf1a30Sjl139090# or http://www.opensolaris.org/os/licensing.
1025cf1a30Sjl139090# See the License for the specific language governing permissions
1125cf1a30Sjl139090# and limitations under the License.
1225cf1a30Sjl139090#
1325cf1a30Sjl139090# When distributing Covered Code, include this CDDL HEADER in each
1425cf1a30Sjl139090# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1525cf1a30Sjl139090# If applicable, add the following below this CDDL HEADER, with the
1625cf1a30Sjl139090# fields enclosed by brackets "[]" replaced with your own identifying
1725cf1a30Sjl139090# information: Portions Copyright [yyyy] [name of copyright owner]
1825cf1a30Sjl139090#
1925cf1a30Sjl139090# CDDL HEADER END
2025cf1a30Sjl139090#
2125cf1a30Sjl139090#
2298157a70Sakolb# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2325cf1a30Sjl139090# Use is subject to license terms.
2425cf1a30Sjl139090#
25*7014882cSRichard Lowe
2625cf1a30Sjl139090#
2725cf1a30Sjl139090#	This makefile drives the production of unix (and unix.o).
2825cf1a30Sjl139090#
2925cf1a30Sjl139090#	sun4u opl implementation architecture dependent
3025cf1a30Sjl139090#
3125cf1a30Sjl139090# uts/sun4u/opl/unix/Makefile
3225cf1a30Sjl139090#
3325cf1a30Sjl139090
3425cf1a30Sjl139090#
3525cf1a30Sjl139090#	Path to the base of the uts directory tree (usually /usr/src/uts).
3625cf1a30Sjl139090#
3725cf1a30Sjl139090UTSBASE	= ../../..
3825cf1a30Sjl139090
3925cf1a30Sjl139090#
4025cf1a30Sjl139090#	Define the module and object file sets.
4125cf1a30Sjl139090#
4225cf1a30Sjl139090UNIX		= unix
4325cf1a30Sjl139090OBJECTS		= $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
4425cf1a30Sjl139090		  $(CORE_OBJS:%=$(OBJS_DIR)/%) \
4525cf1a30Sjl139090		  $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
4625cf1a30Sjl139090LINTS		= $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
4725cf1a30Sjl139090		  $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
4825cf1a30Sjl139090		  $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
4925cf1a30Sjl139090		  $(LINTS_DIR)/vers.ln \
5025cf1a30Sjl139090		  $(LINTS_DIR)/modstubs.ln
51986fd29aSsetje
52986fd29aSsetjeKRTLD_MAPFILE	= $(UTSBASE)/sparc/krtld/mapfile
53986fd29aSsetjeKRTLD_OBJECTS	= $(KRTLD_OBJS:%=$(OBJS_DIR)/%)
54986fd29aSsetjeKRTLD_O		= $(OBJS_DIR)/krtld.o
55986fd29aSsetje
5625cf1a30Sjl139090ROOTMODULE	= $(ROOT_OPL_KERN_DIR)/$(UNIX)
5725cf1a30Sjl139090UNIX_BIN	= $(OBJS_DIR)/$(UNIX)
5825cf1a30Sjl139090
5925cf1a30Sjl139090LIBS		= $(GENLIB) $(PLATLIB) $(CPULIB)
6025cf1a30Sjl139090
6125cf1a30Sjl139090GENUNIX		= genunix
6225cf1a30Sjl139090GENUNIX_DIR	= ../../$(GENUNIX)
6325cf1a30Sjl139090GENOPTS		= -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
6425cf1a30Sjl139090
6525cf1a30Sjl139090CPU_DIR		= .
6625cf1a30Sjl139090CPUOPTS		= -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
6725cf1a30Sjl139090
6825cf1a30Sjl139090PLAT_DIR	= ../../platmod
6925cf1a30Sjl139090PLATOPTS	= -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
7025cf1a30Sjl139090
7125cf1a30Sjl139090LIBOPTS		= $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
7225cf1a30Sjl139090
7325cf1a30Sjl139090CTFEXTRAOBJS	= $(OBJS_DIR)/vers.o
7425cf1a30Sjl139090
7525cf1a30Sjl139090#
7625cf1a30Sjl139090#	Include common rules.
7725cf1a30Sjl139090#
7825cf1a30Sjl139090include $(UTSBASE)/sun4u/opl/Makefile.opl
7925cf1a30Sjl139090
8025cf1a30Sjl139090#
8125cf1a30Sjl139090#	Define targets
8225cf1a30Sjl139090#
8325cf1a30Sjl139090ALL_TARGET	= $(UNIX_BIN)
8425cf1a30Sjl139090LINT_TARGET	= $(LINT_LIB)
8525cf1a30Sjl139090INSTALL_TARGET	= $(UNIX_BIN) $(ROOTMODULE)
8625cf1a30Sjl139090
8725cf1a30Sjl139090#
8825cf1a30Sjl139090#       Overrides
8925cf1a30Sjl139090#
9025cf1a30Sjl139090ALL_BUILDS      = $(ALL_BUILDSONLY64)
9125cf1a30Sjl139090DEF_BUILDS      = $(DEF_BUILDSONLY64)
9225cf1a30Sjl139090SYM_BUILDS      = $(DEF_BUILDSONLY64)
9325cf1a30Sjl139090CLEANLINTFILES  += $(LINT32_FILES)
9425cf1a30Sjl139090
9525cf1a30Sjl139090#
9625cf1a30Sjl139090#	This is UNIX_DIR. Use a short path.
9725cf1a30Sjl139090#
9825cf1a30Sjl139090UNIX_DIR	= .
9925cf1a30Sjl139090
10025cf1a30Sjl139090#
10125cf1a30Sjl139090#	Overrides
10225cf1a30Sjl139090#
103986fd29aSsetjeCLEANFILES	+= $(UNIX_O) $(MODSTUBS_O) $(KRTLD_O) $(KRTLD_OBJECTS) \
104986fd29aSsetje		   $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \
105986fd29aSsetje		   $(CPU_OBJ) $(CPULIB) \
10625cf1a30Sjl139090		   $(DTRACESTUBS_O) $(DTRACESTUBS)
10725cf1a30Sjl139090
10825cf1a30Sjl139090CLOBBERFILES	= $(CLEANFILES) $(UNIX_BIN)
10925cf1a30Sjl139090CLEANLINTFILES	+= $(LINT_LIB)
11025cf1a30Sjl139090
11125cf1a30Sjl139090#
11225cf1a30Sjl139090# lint pass one enforcement
11325cf1a30Sjl139090# Turn on doubleword alignment for 64 bit counter timer registers
11425cf1a30Sjl139090#
11525cf1a30Sjl139090CFLAGS += $(CCVERBOSE) -dalign
11625cf1a30Sjl139090
117*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-parentheses
118*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-uninitialized
119*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-char-subscripts
120*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-variable
121*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-function
122*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-label
123*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-type-limits
124*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-clobbered
125*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-empty-body
126*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-value
127*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-switch
128*7014882cSRichard Lowe
12925cf1a30Sjl139090#
13025cf1a30Sjl139090#	Default build targets.
13125cf1a30Sjl139090#
13225cf1a30Sjl139090.KEEP_STATE:
13325cf1a30Sjl139090
13425cf1a30Sjl139090all:		$(ALL_DEPS)
13525cf1a30Sjl139090
13625cf1a30Sjl139090def:		$(DEF_DEPS)
13725cf1a30Sjl139090
13825cf1a30Sjl139090clean:		$(CLEAN_DEPS)
13925cf1a30Sjl139090
14025cf1a30Sjl139090clobber:	$(CLOBBER_DEPS)
14125cf1a30Sjl139090
14225cf1a30Sjl139090lint:		$(LINT_DEPS)
14325cf1a30Sjl139090
14425cf1a30Sjl139090clean.lint:	$(CLEAN_LINT_DEPS)
14525cf1a30Sjl139090
14625cf1a30Sjl139090install:  	$(INSTALL_DEPS)
14725cf1a30Sjl139090
14825cf1a30Sjl139090symcheck:       $(SYM_DEPS)
14925cf1a30Sjl139090
150986fd29aSsetje$(UNIX_BIN):	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) \
151986fd29aSsetje		$(DTRACESTUBS)
152986fd29aSsetje	$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
153986fd29aSsetje	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
15425cf1a30Sjl139090	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
15525cf1a30Sjl139090	$(POST_PROCESS)
15625cf1a30Sjl139090
157986fd29aSsetjesymcheck.targ:	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS)
15825cf1a30Sjl139090	$(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
159986fd29aSsetje	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
16025cf1a30Sjl139090
16125cf1a30Sjl139090$(UNIX_O):	$(OBJECTS) $(OBJS_DIR)/vers.o
16225cf1a30Sjl139090	$(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
16325cf1a30Sjl139090
164986fd29aSsetje$(KRTLD_O):	$(KRTLD_OBJECTS)
165986fd29aSsetje	$(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS)
166986fd29aSsetje
16725cf1a30Sjl139090#
16825cf1a30Sjl139090#	CPU_OBJ now comprises of 2 object files which come from sun4 common
16925cf1a30Sjl139090#	and from architecture dependent code.  OBJS_DIR is prepended where
17025cf1a30Sjl139090#	CPU_OBJ is defined to allow for building multiple CPU_OBJ's
17125cf1a30Sjl139090#
17225cf1a30Sjl139090$(CPULIB):	$(CPU_OBJ)
17325cf1a30Sjl139090	$(LD) -o $@ -G -h 'cpu/$$CPU' $(CPU_OBJ)
17425cf1a30Sjl139090
17525cf1a30Sjl139090#
17625cf1a30Sjl139090#	The global lint target builds the kernel lint library (llib-lunix.ln)
17725cf1a30Sjl139090#	which is equivalent to a lint of /unix.o. Then all kernel modules for
17825cf1a30Sjl139090#	this architecture are linted against the kernel lint library.
17925cf1a30Sjl139090#
18025cf1a30Sjl139090#	Note:	lint errors in the kernel lint library will be repeated for
18125cf1a30Sjl139090#		each module. It is important that the kernel lint library
18225cf1a30Sjl139090#		be clean to keep the textual output to a reasonable level.
18325cf1a30Sjl139090#
18425cf1a30Sjl139090
18525cf1a30Sjl139090$(LINT_LIB):	$(LINT_LIB_DIR) $(LINTS)
18625cf1a30Sjl139090	@-$(ECHO) "\n$(UNIX): (library construction):"
18725cf1a30Sjl139090	@$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS)
18825cf1a30Sjl139090	@$(MV) $(@F) $@
18925cf1a30Sjl139090
19025cf1a30Sjl139090lintlib:	$(LINT_DEPS)
19125cf1a30Sjl139090
19225cf1a30Sjl139090#
19325cf1a30Sjl139090#	Include common targets.
19425cf1a30Sjl139090#
19525cf1a30Sjl139090include $(UTSBASE)/sun4u/opl/Makefile.targ
196