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