xref: /illumos-gate/usr/src/uts/sun4u/opl/unix/Makefile (revision 0aaef2f5)
125cf1a30Sjl#
225cf1a30Sjl# CDDL HEADER START
325cf1a30Sjl#
425cf1a30Sjl# The contents of this file are subject to the terms of the
525cf1a30Sjl# Common Development and Distribution License (the "License").
625cf1a30Sjl# You may not use this file except in compliance with the License.
725cf1a30Sjl#
825cf1a30Sjl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
925cf1a30Sjl# or http://www.opensolaris.org/os/licensing.
1025cf1a30Sjl# See the License for the specific language governing permissions
1125cf1a30Sjl# and limitations under the License.
1225cf1a30Sjl#
1325cf1a30Sjl# When distributing Covered Code, include this CDDL HEADER in each
1425cf1a30Sjl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1525cf1a30Sjl# If applicable, add the following below this CDDL HEADER, with the
1625cf1a30Sjl# fields enclosed by brackets "[]" replaced with your own identifying
1725cf1a30Sjl# information: Portions Copyright [yyyy] [name of copyright owner]
1825cf1a30Sjl#
1925cf1a30Sjl# CDDL HEADER END
2025cf1a30Sjl#
2125cf1a30Sjl#
2298157a70Sakolb# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2325cf1a30Sjl# Use is subject to license terms.
2491ab9467SPatrick Mooney# Copyright 2019 Joyent, Inc.
2525cf1a30Sjl#
267014882cSRichard Lowe
2725cf1a30Sjl#
2825cf1a30Sjl#	This makefile drives the production of unix (and unix.o).
2925cf1a30Sjl#
3025cf1a30Sjl#	sun4u opl implementation architecture dependent
3125cf1a30Sjl#
3225cf1a30Sjl# uts/sun4u/opl/unix/Makefile
3325cf1a30Sjl#
3425cf1a30Sjl
3525cf1a30Sjl#
3625cf1a30Sjl#	Path to the base of the uts directory tree (usually /usr/src/uts).
3725cf1a30Sjl#
3825cf1a30SjlUTSBASE	= ../../..
3925cf1a30Sjl
4025cf1a30Sjl#
4125cf1a30Sjl#	Define the module and object file sets.
4225cf1a30Sjl#
4325cf1a30SjlUNIX		= unix
4425cf1a30SjlOBJECTS		= $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
4525cf1a30Sjl		  $(CORE_OBJS:%=$(OBJS_DIR)/%) \
4625cf1a30Sjl		  $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
47986fd29aSsetje
48986fd29aSsetjeKRTLD_MAPFILE	= $(UTSBASE)/sparc/krtld/mapfile
49986fd29aSsetjeKRTLD_OBJECTS	= $(KRTLD_OBJS:%=$(OBJS_DIR)/%)
50986fd29aSsetjeKRTLD_O		= $(OBJS_DIR)/krtld.o
51986fd29aSsetje
5225cf1a30SjlROOTMODULE	= $(ROOT_OPL_KERN_DIR)/$(UNIX)
5325cf1a30SjlUNIX_BIN	= $(OBJS_DIR)/$(UNIX)
5425cf1a30Sjl
5525cf1a30SjlLIBS		= $(GENLIB) $(PLATLIB) $(CPULIB)
5625cf1a30Sjl
5725cf1a30SjlGENUNIX		= genunix
5825cf1a30SjlGENUNIX_DIR	= ../../$(GENUNIX)
5925cf1a30SjlGENOPTS		= -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
6025cf1a30Sjl
6125cf1a30SjlCPU_DIR		= .
6225cf1a30SjlCPUOPTS		= -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
6325cf1a30Sjl
6425cf1a30SjlPLAT_DIR	= ../../platmod
6525cf1a30SjlPLATOPTS	= -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
6625cf1a30Sjl
6725cf1a30SjlLIBOPTS		= $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
6825cf1a30Sjl
6925cf1a30SjlCTFEXTRAOBJS	= $(OBJS_DIR)/vers.o
7025cf1a30Sjl
7125cf1a30Sjl#
7225cf1a30Sjl#	Include common rules.
7325cf1a30Sjl#
7425cf1a30Sjlinclude $(UTSBASE)/sun4u/opl/Makefile.opl
7525cf1a30Sjl
7625cf1a30Sjl#
7725cf1a30Sjl#	Define targets
7825cf1a30Sjl#
7925cf1a30SjlALL_TARGET	= $(UNIX_BIN)
8025cf1a30SjlINSTALL_TARGET	= $(UNIX_BIN) $(ROOTMODULE)
8125cf1a30Sjl
8225cf1a30Sjl#
8325cf1a30Sjl#       Overrides
8425cf1a30Sjl#
8525cf1a30SjlALL_BUILDS      = $(ALL_BUILDSONLY64)
8625cf1a30SjlDEF_BUILDS      = $(DEF_BUILDSONLY64)
8725cf1a30SjlSYM_BUILDS      = $(DEF_BUILDSONLY64)
8825cf1a30Sjl
8925cf1a30Sjl#
9025cf1a30Sjl#	This is UNIX_DIR. Use a short path.
9125cf1a30Sjl#
9225cf1a30SjlUNIX_DIR	= .
9325cf1a30Sjl
9425cf1a30Sjl#
9525cf1a30Sjl#	Overrides
9625cf1a30Sjl#
97986fd29aSsetjeCLEANFILES	+= $(UNIX_O) $(MODSTUBS_O) $(KRTLD_O) $(KRTLD_OBJECTS) \
98986fd29aSsetje		   $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \
99986fd29aSsetje		   $(CPU_OBJ) $(CPULIB) \
10025cf1a30Sjl		   $(DTRACESTUBS_O) $(DTRACESTUBS)
10125cf1a30Sjl
10225cf1a30SjlCLOBBERFILES	= $(CLEANFILES) $(UNIX_BIN)
10325cf1a30Sjl
10425cf1a30Sjl# Turn on doubleword alignment for 64 bit counter timer registers
105*0aaef2f5SRichard LoweCFLAGS += -dalign
10625cf1a30Sjl
107*0aaef2f5SRichard Lowe#
108*0aaef2f5SRichard Lowe# For now, disable these warnings; maintainers should endeavor
109*0aaef2f5SRichard Lowe# to investigate and remove these for maximum coverage.
110*0aaef2f5SRichard Lowe# Please do not carry these forward to new Makefiles.
111*0aaef2f5SRichard Lowe#
112*0aaef2f5SRichard LoweCFLAGS		+= $(CCVERBOSE)
1137014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-parentheses
114d3b5f563SJohn LevonCERRWARN	+= $(CNOWARN_UNINIT)
1157014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-char-subscripts
1167014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-variable
1177014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-function
1187014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-label
1197014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-type-limits
1207014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-clobbered
1217014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-empty-body
1227014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-value
1237014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-switch
1247014882cSRichard Lowe
12525cf1a30Sjl#
12625cf1a30Sjl#	Default build targets.
12725cf1a30Sjl#
12825cf1a30Sjl.KEEP_STATE:
12925cf1a30Sjl
13025cf1a30Sjlall:		$(ALL_DEPS)
13125cf1a30Sjl
13225cf1a30Sjldef:		$(DEF_DEPS)
13325cf1a30Sjl
13425cf1a30Sjlclean:		$(CLEAN_DEPS)
13525cf1a30Sjl
13625cf1a30Sjlclobber:	$(CLOBBER_DEPS)
13725cf1a30Sjl
13885f4cb87SRichard Loweinstall:	$(INSTALL_DEPS)
13925cf1a30Sjl
14025cf1a30Sjlsymcheck:       $(SYM_DEPS)
14125cf1a30Sjl
14291ab9467SPatrick Mooney$(UNIX_BIN):	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(UNIX_MAPFILE) $(LIBS) \
14385f4cb87SRichard Lowe		$(DTRACESTUBS)
14491ab9467SPatrick Mooney	$(LD) -dy -b -o $@ -e _start -M $(UNIX_MAPFILE) \
14585f4cb87SRichard Lowe	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
14625cf1a30Sjl	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
14725cf1a30Sjl	$(POST_PROCESS)
14825cf1a30Sjl
14985f4cb87SRichard Lowesymcheck.targ:	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS)
15091ab9467SPatrick Mooney	$(LD) -dy -b -o $(SYM_MOD) -M $(UNIX_MAPFILE) \
15185f4cb87SRichard Lowe	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
15225cf1a30Sjl
15325cf1a30Sjl$(UNIX_O):	$(OBJECTS) $(OBJS_DIR)/vers.o
15425cf1a30Sjl	$(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
15525cf1a30Sjl
156986fd29aSsetje$(KRTLD_O):	$(KRTLD_OBJECTS)
157986fd29aSsetje	$(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS)
158986fd29aSsetje
15925cf1a30Sjl#
16025cf1a30Sjl#	CPU_OBJ now comprises of 2 object files which come from sun4 common
16125cf1a30Sjl#	and from architecture dependent code.  OBJS_DIR is prepended where
16225cf1a30Sjl#	CPU_OBJ is defined to allow for building multiple CPU_OBJ's
16325cf1a30Sjl#
16425cf1a30Sjl$(CPULIB):	$(CPU_OBJ)
16585f4cb87SRichard Lowe	$(LD) -o $@ $(GSHARED) -h 'cpu/$$CPU' $(CPU_OBJ)
16625cf1a30Sjl
16725cf1a30Sjl#
16825cf1a30Sjl#	Include common targets.
16925cf1a30Sjl#
17025cf1a30Sjlinclude $(UTSBASE)/sun4u/opl/Makefile.targ
171