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.
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.
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]
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
28 # This makefile drives the production of unix (and unix.o).
30 # sun4u serengeti implementation architecture dependent
34 # Path to the base of the uts directory tree (usually /usr/src/uts).
39 # Define the module and object file sets.
42 OBJECTS
= $(SPECIAL_OBJS
:%=$(OBJS_DIR
)/%) \
43 $(CORE_OBJS
:%=$(OBJS_DIR
)/%) \
44 $(MACH_NOT_YET_KMODS
:%=$(OBJS_DIR
)/%)
45 LINTS
= $(SPECIAL_OBJS
:%.o
=$(LINTS_DIR
)/%.ln
) \
46 $(CORE_OBJS
:%.o
=$(LINTS_DIR
)/%.ln
) \
47 $(MACH_NOT_YET_KMODS
:%.o
=$(LINTS_DIR
)/%.ln
) \
48 $(LINTS_DIR
)/vers.ln \
49 $(LINTS_DIR
)/modstubs.ln
51 KRTLD_MAPFILE
= $(UTSBASE
)/sparc
/krtld
/mapfile
52 KRTLD_OBJECTS
= $(KRTLD_OBJS
:%=$(OBJS_DIR
)/%)
53 KRTLD_O
= $(OBJS_DIR
)/krtld.o
55 ROOTMODULE
= $(ROOT_SERENGETI_KERN_DIR
)/$(UNIX
)
56 UNIX_BIN
= $(OBJS_DIR
)/$(UNIX
)
58 LIBS
= $(GENLIB
) $(PLATLIB
) $(CPULIB
)
61 GENUNIX_DIR
= ..
/..
/$(GENUNIX
)
62 GENOPTS
= -L
$(GENUNIX_DIR
)/$(OBJS_DIR
) -l
$(GENUNIX
)
65 CPUOPTS
= -L
$(CPU_DIR
)/$(OBJS_DIR
) -l
$(CPUNAME
)
67 PLAT_DIR
= ..
/..
/platmod
68 PLATOPTS
= -L
$(PLAT_DIR
)/$(OBJS_DIR
) -l
$(PLATMOD
)
70 LIBOPTS
= $(GENOPTS
) $(PLATOPTS
) $(CPUOPTS
)
72 CTFEXTRAOBJS
= $(OBJS_DIR
)/vers.o
75 # Include common rules.
77 include $(UTSBASE
)/sun4u
/serengeti
/Makefile.serengeti
82 ALL_TARGET
= $(UNIX_BIN
)
83 LINT_TARGET
= $(LINT_LIB
)
84 INSTALL_TARGET
= $(UNIX_BIN
) $(ROOTMODULE
)
89 ALL_BUILDS
= $(ALL_BUILDSONLY64
)
90 DEF_BUILDS
= $(DEF_BUILDSONLY64
)
91 SYM_BUILDS
= $(DEF_BUILDSONLY64
)
92 CLEANLINTFILES
+= $(LINT32_FILES
)
95 # This is UNIX_DIR. Use a short path.
102 CLEANFILES
+= $(UNIX_O
) $(MODSTUBS_O
) $(KRTLD_O
) $(KRTLD_OBJECTS
) \
103 $(OBJS_DIR
)/vers.c
$(OBJS_DIR
)/vers.o \
104 $(CPU_OBJ
) $(CPULIB
) \
105 $(DTRACESTUBS_O
) $(DTRACESTUBS
)
107 CLOBBERFILES
= $(CLEANFILES
) $(UNIX_BIN
)
108 CLEANLINTFILES
+= $(LINT_LIB
)
111 # lint pass one enforcement
112 # Turn on doubleword alignment for 64 bit counter timer registers
114 CFLAGS
+= $(CCVERBOSE
) -dalign
116 CERRWARN
+= -_gcc
=-Wno-parentheses
117 CERRWARN
+= -_gcc
=-Wno-uninitialized
118 CERRWARN
+= -_gcc
=-Wno-char-subscripts
119 CERRWARN
+= -_gcc
=-Wno-unused-variable
120 CERRWARN
+= -_gcc
=-Wno-unused-function
121 CERRWARN
+= -_gcc
=-Wno-unused-label
122 CERRWARN
+= -_gcc
=-Wno-type-limits
123 CERRWARN
+= -_gcc
=-Wno-clobbered
124 CERRWARN
+= -_gcc
=-Wno-empty-body
125 CERRWARN
+= -_gcc
=-Wno-unused-value
126 CERRWARN
+= -_gcc
=-Wno-switch
129 # Default build targets.
139 clobber: $(CLOBBER_DEPS
)
143 clean.lint
: $(CLEAN_LINT_DEPS
)
145 install: $(INSTALL_DEPS
)
147 symcheck
: $(SYM_DEPS
)
149 $(UNIX_BIN
): $(UNIX_O
) $(KRTLD_O
) $(MODSTUBS_O
) $(MAPFILE
) $(LIBS
) \
151 $(LD
) -dy
-b
-o
$@
-e _start
-M
$(MAPFILE
) \
152 $(UNIX_O
) $(KRTLD_O
) $(MODSTUBS_O
) $(LIBOPTS
) $(DTRACESTUBS
)
153 $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX
)
156 symcheck.targ
: $(UNIX_O
) $(KRTLD_O
) $(MODSTUBS_O
) $(LIBS
)
157 $(LD
) -dy
-b
-o
$(SYM_MOD
) -M
$(MAPFILE
) \
158 $(UNIX_O
) $(KRTLD_O
) $(MODSTUBS_O
) $(LIBOPTS
) $(DTRACESTUBS
)
160 $(UNIX_O
): $(OBJECTS
) $(OBJS_DIR
)/vers.o
161 $(LD
) -r
-o
$@
$(OBJECTS
) $(OBJS_DIR
)/vers.o
163 $(KRTLD_O
): $(KRTLD_OBJECTS
)
164 $(LD
) -r
-o
$@
-M
$(KRTLD_MAPFILE
) $(KRTLD_OBJECTS
)
167 # CPU_OBJ now comprises of 2 object files which come from sun4 common
168 # and from architecture dependent code. OBJS_DIR is prepended where
169 # CPU_OBJ is defined to allow for building multiple CPU_OBJ's
171 $(CPULIB
): $(CPU_OBJ
)
172 $(BUILD.SO
) $(CPU_OBJ
)
175 # The global lint target builds the kernel lint library (llib-lunix.ln)
176 # which is equivalent to a lint of /unix.o. Then all kernel modules for
177 # this architecture are linted against the kernel lint library.
179 # Note: lint errors in the kernel lint library will be repeated for
180 # each module. It is important that the kernel lint library
181 # be clean to keep the textual output to a reasonable level.
184 $(LINT_LIB
): $(LINT_LIB_DIR
) $(LINTS
)
185 @
-$(ECHO
) "\n$(UNIX): (library construction):"
186 @
$(LINT
) -o
$(UNIX
) $(LINTFLAGS
) $(LINTS
)
189 lintlib
: $(LINT_DEPS
)
192 # Include common targets.
194 include $(UTSBASE
)/sun4u
/serengeti
/Makefile.targ