Makefile.sun4u.shared revision 1341:6d7c4f090a72
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	This makefile contains the common definitions for the sun4u unix
29#	and all sun4u implementation architecture dependent modules.
30#
31
32#
33#	Machine type (implementation architecture):
34#
35PLATFORM	 = sun4u
36PROMIF		 = ieee1275
37PSMBASE		 = $(UTSBASE)/../psm
38
39#
40# Definitions for the platform-specific /platform directories.
41#
42# PLATFORMS designates those sun4u machines which have no platform
43# specific code.
44#
45# IMPLEMENTATIONS is used to designate sun4u machines which do have
46# platform specific modules (perhaps including their own unix).  All
47# code specific to a given implementation resides in the appropriately
48# named subdirectory.   This requires these platforms to have their
49# own Makefiles to define ROOT_PLAT_DIRS, USR_PLAT_DIRS, etc.
50#
51# So if we had an implementation named 'foo', we would need the following
52# Makefiles in the foo subdirectory:
53#
54#	sun4u/foo/Makefile
55#	sun4u/foo/Makefile.foo
56#	sun4u/foo/Makefile.targ
57#
58
59#
60# /usr/platform/$(IMPLEMENTED_PLATFORM) is created as a directory that
61# all the $(LINKED_PLATFORMS) link to.
62#
63IMPLEMENTED_PLATFORM	= SUNW,Ultra-2
64
65LINKED_PLATFORMS	+= SUNW,Ultra-30
66LINKED_PLATFORMS	+= SUNW,Ultra-60
67
68#
69# all PLATFORMS that do not belong in the $(IMPLEMENTATIONS) list
70# ie. all desktop platforms
71#
72PLATFORMS                = $(IMPLEMENTED_PLATFORM)
73PLATFORMS               += $(LINKED_PLATFORMS)
74
75ROOT_PLAT_DIRS		= $(PLATFORMS:%=$(ROOT_PLAT_DIR)/%)
76USR_PLAT_DIRS		= $(PLATFORMS:%=$(USR_PLAT_DIR)/%)
77
78USR_DESKTOP_DIR		= $(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM)
79USR_DESKTOP_INC_DIR	= $(USR_DESKTOP_DIR)/include
80USR_DESKTOP_SBIN_DIR	= $(USR_DESKTOP_DIR)/sbin
81USR_DESKTOP_LIB_DIR	= $(USR_DESKTOP_DIR)/lib
82
83#
84# Welcome to SPARC V9.
85#
86
87#
88#	Define supported builds
89#
90DEF_BUILDS	= $(DEF_BUILDS64)
91ALL_BUILDS	= $(ALL_BUILDS64)
92
93#
94#	Everybody needs to know how to build modstubs.o and to locate unix.o
95#
96UNIX_DIR	 = $(UTSBASE)/$(PLATFORM)/unix
97GENLIB_DIR	 = $(UTSBASE)/$(PLATFORM)/genunix
98MODSTUBS_DIR	 = $(UNIX_DIR)
99DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
100LINTS_DIR	 = $(OBJS_DIR)
101LINT_LIB_DIR	 = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
102 
103DTRACESTUBS_O	 = $(OBJS_DIR)/dtracestubs.o
104DTRACESTUBS	 = $(OBJS_DIR)/libdtracestubs.so
105
106UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
107MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
108GENLIB	 	 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
109
110LINT_LIB	 = $(LINT_LIB_DIR)/llib-lunix.ln
111GEN_LINT_LIB	 = $(LINT_LIB_DIR)/llib-lgenunix.ln
112
113LINT64_DIRS	 = $(LINT64_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
114LINT64_FILES	 = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)
115
116#
117#	cpu and platform modules need to know how to build their own symcheck module
118#
119PLATMOD		 = platmod
120PLATLIB		 = $(PLAT_DIR)/$(OBJS_DIR)/libplatmod.so
121
122CPUNAME		 = cpu
123CPULIB		 = $(CPU_DIR)/$(OBJS_DIR)/libcpu.so
124
125SYM_MOD		 = $(OBJS_DIR)/unix.sym
126
127#
128#	Include the makefiles which define build rule templates, the
129#	collection of files per module, and a few specific flags. Note
130#	that order is significant, just as with an include path. The
131#	first build rule template which matches the files name will be
132#	used. By including these in order from most machine dependent
133#	to most machine independent, we allow a machine dependent file
134#	to be used in preference over a machine independent version
135#	(Such as a machine specific optimization, which preserves the
136#	interfaces.)
137#
138include $(UTSBASE)/sun4/Makefile.files
139include $(UTSTREE)/$(PLATFORM)/Makefile.files
140include $(UTSBASE)/sfmmu/Makefile.files
141include $(UTSBASE)/sparc/v9/Makefile.files
142include $(UTSBASE)/sparc/Makefile.files
143include $(UTSTREE)/sun/Makefile.files
144include $(SRC)/psm/promif/$(PROMIF)/common/Makefile.files
145include $(SRC)/psm/promif/$(PROMIF)/$(PLATFORM)/Makefile.files
146include $(UTSTREE)/common/Makefile.files
147
148#
149#	Include machine independent rules. Note that this does not imply
150#	that the resulting module from rules in Makefile.uts is	machine
151#	independent. Only that the build rules are machine independent.
152#
153include $(UTSBASE)/Makefile.uts
154
155# These come after Makefile.uts (for CLOSED_BUILD).
156IMPLEMENTATIONS		 = tazmo .WAIT
157IMPLEMENTATIONS		+= starfire .WAIT
158IMPLEMENTATIONS		+= javelin .WAIT
159IMPLEMENTATIONS		+= darwin .WAIT
160IMPLEMENTATIONS		+= quasar .WAIT
161IMPLEMENTATIONS		+= grover .WAIT
162IMPLEMENTATIONS		+= enchilada .WAIT
163IMPLEMENTATIONS		+= taco .WAIT
164IMPLEMENTATIONS		+= mpxu .WAIT
165IMPLEMENTATIONS		+= excalibur .WAIT
166IMPLEMENTATIONS		+= montecarlo .WAIT
167IMPLEMENTATIONS		+= serengeti .WAIT
168IMPLEMENTATIONS		+= littleneck .WAIT
169IMPLEMENTATIONS		+= starcat .WAIT
170IMPLEMENTATIONS		+= daktari .WAIT
171IMPLEMENTATIONS		+= cherrystone .WAIT
172IMPLEMENTATIONS		+= fjlite .WAIT
173IMPLEMENTATIONS		+= snowbird .WAIT
174IMPLEMENTATIONS		+= schumacher .WAIT
175IMPLEMENTATIONS		+= blade .WAIT
176IMPLEMENTATIONS		+= boston .WAIT
177IMPLEMENTATIONS		+= seattle .WAIT
178IMPLEMENTATIONS		+= chicago .WAIT
179IMPLEMENTATIONS		+= sunfire .WAIT
180
181$(CLOSED_BUILD)CLOSED_IMPLEMENTATIONS	= chalupa .WAIT
182$(CLOSED_BUILD)CLOSED_IMPLEMENTATIONS	+= ents .WAIT
183$(CLOSED_BUILD)CLOSED_IMPLEMENTATIONS	+= lw2plus .WAIT
184$(CLOSED_BUILD)CLOSED_IMPLEMENTATIONS	+= lw8 .WAIT
185$(CLOSED_BUILD)CLOSED_IMPLEMENTATIONS	+= makaha .WAIT
186
187#
188#	machine specific optimization, override default in Makefile.master
189#
190CC_XARCH	= -xarch=v9a
191AS_XARCH	= -xarch=v9a
192COPTIMIZE	= -xO3
193CCMODE		= -Xa
194
195CFLAGS		= -xchip=ultra $(CCABS32) $(CCREGSYM)
196CFLAGS		+= $(CC_XARCH)
197CFLAGS		+= $(COPTIMIZE)
198CFLAGS		+= $(EXTRA_CFLAGS)
199CFLAGS		+= $(XAOPT)
200CFLAGS		+= $(INLINES) -D_ASM_INLINES
201CFLAGS		+= $(CCMODE)
202CFLAGS		+= $(SPACEFLAG)
203CFLAGS		+= $(CERRWARN)
204CFLAGS		+= $(CTF_FLAGS)
205CFLAGS		+= $(C99MODE)
206CFLAGS		+= $(CCUNBOUND)
207CFLAGS		+= -xregs=no%float
208
209ASFLAGS		+= $(AS_XARCH)
210
211AS_INC_PATH	+= -I$(DSF_DIR)/$(OBJS_DIR)
212
213LINT_KMODS	+= $(GENUNIX_KMODS)
214
215LINT_DEFS	= -Xarch=v9
216
217#
218#	The following must be defined for all implementations:
219#
220#	MAPFILE:		ld mapfile for the build of kernel/unix.
221#	MODSTUBS:		Module stubs source file.
222#	GENCONST_SRC:		genconst.c
223#	OFFSETS:		offsets.in
224#	PLATFORM_OFFSETS:	Platform specific mach_offsets.in
225#	FDOFFSETS:		fd_offsets.in
226#
227MAPFILE		 = $(UTSBASE)/sun4/conf/Mapfile
228MODSTUBS	 = $(UTSBASE)/sparc/ml/modstubs.s
229GENCONST_SRC	 = $(UTSBASE)/sun4/ml/genconst.c
230OFFSETS		 = $(UTSBASE)/sun4/ml/offsets.in
231PLATFORM_OFFSETS = $(UTSBASE)/sun4u/ml/mach_offsets.in
232FDOFFSETS 	 = $(UTSBASE)/sun/io/fd_offsets.in
233
234#
235#	Define the actual specific platforms
236#
237
238MACHINE_DEFS	= -D$(PLATFORM) -D_MACHDEP -DSFMMU
239
240$(MPSAS_BUILD)MACHINE_DEFS      += -DMPSAS
241
242#
243#	Software workarounds for hardware "features"
244#
245
246include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
247
248#
249#	Debugging level
250#
251#	Special knowledge of which special debugging options effect which
252#	file is used to optimize the build if these flags are changed.
253#
254#	XXX: The above could possibly be done for more flags and files, but
255#	     is left as an experiment to the interested reader. Be forewarned,
256#	     that excessive use could lead to maintenance difficulties.
257#
258#	Note: kslice can be enabled for the sun4u, but is disabled by default
259#	      in all cases.
260#
261
262DEBUG_DEFS_OBJ64	=
263DEBUG_DEFS_DBG64	= -DDEBUG
264DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
265
266DEBUG_COND_OBJ64	:sh = echo \\043
267DEBUG_COND_DBG64	= 
268IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
269
270$(IF_DEBUG_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPDEBUG
271$(IF_DEBUG_OBJ)mach_trap.o	:=	DEBUG_DEFS	+= -DTRAPDEBUG
272$(IF_DEBUG_OBJ)syscall_trap.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
273$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=0
274
275IF_TRAPTRACE_OBJ = $(IF_DEBUG_OBJ)
276# comment this out for a non-debug kernel with TRAPTRACE
277#IF_TRAPTRACE_OBJ = $(OBJS_DIR)/
278
279$(IF_TRAPTRACE_OBJ)mach_locore.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
280$(IF_TRAPTRACE_OBJ)mlsetup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
281$(IF_TRAPTRACE_OBJ)syscall_trap.o 	:=	DEBUG_DEFS	+= -DTRAPTRACE
282$(IF_TRAPTRACE_OBJ)startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
283$(IF_TRAPTRACE_OBJ)mach_startup.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
284$(IF_TRAPTRACE_OBJ)mp_startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
285$(IF_TRAPTRACE_OBJ)cpu_states.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
286$(IF_TRAPTRACE_OBJ)mach_cpu_states.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
287$(IF_TRAPTRACE_OBJ)interrupt.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
288$(IF_TRAPTRACE_OBJ)mach_interrupt.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
289$(IF_TRAPTRACE_OBJ)sfmmu_asm.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
290$(IF_TRAPTRACE_OBJ)trap_table.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
291$(IF_TRAPTRACE_OBJ)xc.o			:=	DEBUG_DEFS	+= -DTRAPTRACE
292$(IF_TRAPTRACE_OBJ)mach_xc.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
293$(IF_TRAPTRACE_OBJ)wbuf.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
294$(IF_TRAPTRACE_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
295$(IF_TRAPTRACE_OBJ)mach_trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
296$(IF_TRAPTRACE_OBJ)x_call.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
297$(IF_TRAPTRACE_OBJ)spitfire_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
298$(IF_TRAPTRACE_OBJ)us3_common_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
299$(IF_TRAPTRACE_OBJ)us3_cheetah_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
300$(IF_TRAPTRACE_OBJ)us3_cheetahplus_asm.o :=	DEBUG_DEFS	+= -DTRAPTRACE
301$(IF_TRAPTRACE_OBJ)us3_jalapeno_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
302
303# Comment these out if you don't want dispatcher lock statistics.
304
305#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
306#$(IF_DEBUG_OBJ)disp.o		:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
307
308# Comment these out if you don't want dispatcher debugging 
309
310#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_DEBUG
311
312#
313#	Build `options'. These are mostly historical and the need for these
314#	is largely removed by the module technology. However, the static
315#	build will continue to require these.
316#
317OPTION_DEFS	 = -DC2_AUDIT
318
319#
320#	Collect the preprocessor definitions to be associated with *all*
321#	files.
322#
323ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
324		   $(OPTION_DEFS)
325GENCONST_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS)
326
327#
328# ----- TRANSITIONAL SECTION --------------------------------------------------
329#
330
331#
332#	Not everything which *should* be a module is a module yet. The
333#	following is a list of such objects which are currently part of
334#	the base kernel but should soon become kmods.
335#
336MACH_NOT_YET_KMODS	 = $(AUTOCONF_OBJS)
337
338#
339# ----- END OF TRANSITIONAL SECTION -------------------------------------------
340#
341
342#
343#	The kernels modules which are "implementation architecture"
344#	specific for this machine are enumerated below. Note that most
345#	of these modules must exist (in one form or another) for each
346#	architecture.
347#
348#	Common Drivers (usually pseudo drivers) (/kernel/drv):
349#
350
351#
352#	Machine Specific Driver Modules (/kernel/drv):
353#
354#	XXX: How many of these are really machine specific?
355#
356DRV_KMODS	+= bbc_beep
357DRV_KMODS	+= cgsix
358DRV_KMODS	+= cpc
359DRV_KMODS	+= dma fd
360DRV_KMODS	+= rootnex sbusmem upa64s zs zsh
361DRV_KMODS	+= sbus
362DRV_KMODS	+= pcisch pcipsy simba
363DRV_KMODS	+= px
364DRV_KMODS	+= ebus
365DRV_KMODS	+= su
366DRV_KMODS	+= tod
367DRV_KMODS	+= power
368DRV_KMODS	+= epic
369DRV_KMODS       += fcode
370DRV_KMODS	+= grbeep
371DRV_KMODS	+= pcf8584 max1617 seeprom tda8444 pca9556
372DRV_KMODS	+= ics951601 adm1031
373DRV_KMODS	+= lm75 ltc1427 pcf8591 pcf8574 ssc050 ssc100
374DRV_KMODS	+= pic16f819
375DRV_KMODS	+= pic16f747
376DRV_KMODS	+= adm1026
377DRV_KMODS	+= us
378DRV_KMODS	+= ppm schppm jbusppm
379DRV_KMODS	+= mc-us3
380DRV_KMODS	+= mc-us3i
381DRV_KMODS       += smbus
382DRV_KMODS	+= db21554
383DRV_KMODS	+= gpio_87317
384DRV_KMODS	+= isadma
385DRV_KMODS	+= sbbc
386DRV_KMODS	+= pmubus
387DRV_KMODS	+= pmugpio
388DRV_KMODS	+= pmc
389DRV_KMODS	+= trapstat
390DRV_KMODS	+= dmfe
391
392$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= ctsmc
393$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= i2bsc 
394$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= m1535ppm
395$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= memtest
396$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= mi2cv
397$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= rmc_comm
398$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= rmcadm
399$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= rmclomv
400$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= scmi2c
401$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= sf
402$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= smbus_ara
403$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= wrsmd
404
405#
406#	Exec Class Modules (/kernel/exec):
407#
408EXEC_KMODS	+=
409
410#
411#	Scheduling Class Modules (/kernel/sched):
412#
413SCHED_KMODS	+=
414
415#
416#	File System Modules (/kernel/fs):
417#
418FS_KMODS	+=
419
420#
421#	Streams Modules (/kernel/strmod):
422#
423STRMOD_KMODS	+= kb
424
425#
426#	'System' Modules (/kernel/sys):
427#
428SYS_KMODS	+=
429
430#
431#	'User' Modules (/kernel/misc):
432#
433MISC_KMODS	+= obpsym bootdev vis cpr platmod md5 sha1 i2c_svc
434MISC_KMODS	+= sbd
435
436MISC_KMODS	+= fcodem fcpci pcicfg.e
437MISC_KMODS	+= kmech_krb5
438MISC_KMODS	+= zuluvm
439
440$(CLOSED_BUILD)CLOSED_MISC_KMODS	+= gptwo_cpu gptwocfg
441
442#
443#	Software Cryptographic Providers (/kernel/crypto):
444#
445# Don't build some of these for OpenSolaris, since they will be
446# replaced by binaries that are signed by Sun RE.
447#
448$(CLOSED_BUILD)CRYPTO_KMODS	+= aes
449$(CLOSED_BUILD)CRYPTO_KMODS	+= arcfour
450$(CLOSED_BUILD)CRYPTO_KMODS	+= des
451CRYPTO_KMODS	+= rsa
452
453#
454#	generic-unix module (/kernel/genunix):
455#
456GENUNIX_KMODS	+= genunix
457
458#	'User' "Modules" excluded from the Full Kernel lint target:
459#
460$(CLOSED_BUILD)CLOSED_NLMISC_KMODS	+= forthdebug
461
462#
463#	Modules eXcluded from the product:
464#
465XMODS		+=
466
467#
468#	cpu modules
469#
470CPU_KMODS	+= cheetah cheetahplus jalapeno serrano spitfire hummingbird
471
472#
473#	sun4u 'TOD' Modules (/platform/.../kernel/tod):
474#
475TOD_KMODS	+= todds1287 todds1337 todmostek todstarfire 
476TOD_KMODS	+= todm5819 todblade todm5823 todbq4802
477
478$(CLOSED_BUILD)CLOSED_TOD_KMODS	+= todm5819p_rmc todsg todstarcat
479
480#
481#	Performance Counter BackEnd Modules (/usr/kernel/pcbe):
482#
483PCBE_KMODS	+= us234_pcbe
484