8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / uts / sun4u / unix / Makefile
blob8ff31a51ff598aceaedc5e63d140499c827ff15c
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
23 # Copyright 2009 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 implementation architecture dependent
34 # Path to the base of the uts directory tree (usually /usr/src/uts).
36 UTSBASE = ../..
39 # Define the module and object file sets.
41 UNIX = unix
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 $(KRTLD_OBJS:%.o=$(LINTS_DIR)/%.ln) \
48 $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
49 $(LINTS_DIR)/vers.ln \
50 $(LINTS_DIR)/modstubs.ln
52 KRTLD_MAPFILE = $(UTSBASE)/sparc/krtld/mapfile
53 KRTLD_OBJECTS = $(KRTLD_OBJS:%=$(OBJS_DIR)/%)
54 KRTLD_O = $(OBJS_DIR)/krtld.o
56 ROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(UNIX)
57 UNIX32_LINK = $(ROOT_PSM_KERN_DIR_32)/$(UNIX)
58 UNIX_BIN = $(OBJS_DIR)/$(UNIX)
59 #UNIX_GLOM = $(OBJS_DIR)/unix.glom
61 LIBS = $(GENLIB) $(PLATLIB) $(CPULIB)
63 GENUNIX = genunix
64 GENUNIX_DIR = ../$(GENUNIX)
65 GENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
67 CPU_DIR = .
68 CPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
70 PLAT_DIR = ../platmod
71 PLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
73 LIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
75 CTFEXTRAOBJS = $(OBJS_DIR)/vers.o
78 # Include common rules.
80 include $(UTSBASE)/sun4u/Makefile.sun4u
83 # Define targets
85 ALL_TARGET = $(UNIX_BIN)
86 LINT_TARGET = $(LINT_LIB)
87 INSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE) $(UNIX32_LINK)
90 # This is UNIX_DIR. Use a short path.
92 UNIX_DIR = .
95 # Overrides
97 CLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(KRTLD_O) $(KRTLD_OBJECTS) \
98 $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \
99 $(CPU_OBJ) $(CPULIB) \
100 $(DTRACESTUBS_O) $(DTRACESTUBS)
102 CLOBBERFILES = $(CLEANFILES) $(UNIX_BIN)
103 CLEANLINTFILES += $(LINT_LIB)
106 # lint pass one enforcement
107 # Turn on doubleword alignment for 64 bit counter timer registers
109 CFLAGS += $(CCVERBOSE) -dalign
112 # For now, disable these lint checks; maintainers should endeavor
113 # to investigate and remove these for maximum lint coverage.
114 # Please do not carry these forward to new Makefiles.
116 LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
117 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
118 LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
119 LINTTAGS += -erroff=E_STATIC_UNUSED
120 LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
121 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
123 CERRWARN += -_gcc=-Wno-parentheses
124 CERRWARN += -_gcc=-Wno-uninitialized
125 CERRWARN += -_gcc=-Wno-char-subscripts
126 CERRWARN += -_gcc=-Wno-unused-variable
127 CERRWARN += -_gcc=-Wno-unused-function
128 CERRWARN += -_gcc=-Wno-unused-label
129 CERRWARN += -_gcc=-Wno-type-limits
130 CERRWARN += -_gcc=-Wno-clobbered
131 CERRWARN += -_gcc=-Wno-empty-body
132 CERRWARN += -_gcc=-Wno-unused-value
133 CERRWARN += -_gcc=-Wno-switch
136 # Default build targets.
138 .KEEP_STATE:
140 def: $(DEF_DEPS)
142 all: $(ALL_DEPS)
144 clean: $(CLEAN_DEPS)
146 clobber: $(CLOBBER_DEPS)
148 lint: $(LINT_DEPS)
150 clean.lint: $(CLEAN_LINT_DEPS)
152 install: $(INSTALL_DEPS)
155 $(UNIX_BIN): $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) \
156 $(DTRACESTUBS)
157 $(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
158 $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
159 $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
160 $(POST_PROCESS)
161 $(CHK4UBINARY)
163 $(UNIX32_LINK): $(ROOT_PSM_KERN_DIR_32) $(UNIX_BIN)
164 -$(RM) $@; ln -s $(SUBDIR64)/$(UNIX) $@
166 symcheck: $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS)
167 $(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
168 $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
170 $(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
171 $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
173 $(KRTLD_O): $(KRTLD_OBJECTS)
174 $(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS)
177 # CPU_OBJ now comprises of 2 object files which come from sun4 common
178 # and from architecture dependent code. OBJS_DIR is prepended where
179 # CPU_OBJ is defined to allow for building multiple CPU_OBJ's
181 $(CPULIB): $(CPU_OBJ)
182 $(BUILD.SO) $(CPU_OBJ)
184 $(PLATLIB):
185 ?@(cd $(PLAT_DIR); pwd; $(MAKE) all.targ)
186 ?@pwd
189 # The global lint target builds the kernel lint library (llib-lunix.ln)
190 # which is equivalent to a lint of /unix.o. Then all kernel modules for
191 # this architecture are linted against the kernel lint library.
193 # Note: lint errors in the kernel lint library will be repeated for
194 # each module. It is important that the kernel lint library
195 # be clean to keep the textual output to a reasonable level.
198 $(LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
199 @pwd
200 @-$(ECHO) "\n$(UNIX): (library construction):"
201 @$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS)
202 @$(MV) $(@F) $@
204 lintlib: $(LINT_DEPS)
207 # Include common targets.
209 include $(UTSBASE)/sun4u/Makefile.targ