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