0
|
1 |
#
|
|
2 |
# CDDL HEADER START
|
|
3 |
#
|
|
4 |
# The contents of this file are subject to the terms of the
|
580
|
5 |
# Common Development and Distribution License (the "License").
|
|
6 |
# You may not use this file except in compliance with the License.
|
0
|
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 |
#
|
580
|
21 |
|
0
|
22 |
#
|
580
|
23 |
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
0
|
24 |
# Use is subject to license terms.
|
|
25 |
#
|
580
|
26 |
# ident "%Z%%M% %I% %E% SMI"
|
|
27 |
#
|
|
28 |
|
0
|
29 |
#
|
|
30 |
# This makefile drives the production of unix (and unix.o).
|
|
31 |
#
|
|
32 |
# sun4u starcat implementation architecture dependent
|
|
33 |
#
|
|
34 |
|
|
35 |
#
|
|
36 |
# Path to the base of the uts directory tree (usually /usr/src/uts).
|
|
37 |
#
|
|
38 |
UTSBASE = ../../..
|
|
39 |
|
|
40 |
#
|
|
41 |
# Define the module and object file sets.
|
|
42 |
#
|
|
43 |
UNIX = unix
|
|
44 |
OBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
|
|
45 |
$(CORE_OBJS:%=$(OBJS_DIR)/%) \
|
|
46 |
$(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
|
|
47 |
LINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
|
|
48 |
$(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
|
|
49 |
$(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
|
|
50 |
$(LINTS_DIR)/vers.ln \
|
|
51 |
$(LINTS_DIR)/modstubs.ln
|
|
52 |
ROOTMODULE = $(ROOT_STARCAT_KERN_DIR)/$(UNIX)
|
|
53 |
UNIX_BIN = $(OBJS_DIR)/$(UNIX)
|
|
54 |
|
|
55 |
KRTLD_32 = misc/krtld
|
|
56 |
KRTLD_64 = misc/$(SUBDIR64)/krtld
|
|
57 |
KRTLD = $(KRTLD_$(CLASS))
|
|
58 |
|
|
59 |
LIBS = $(GENLIB) $(PLATLIB) $(CPULIB)
|
|
60 |
|
|
61 |
GENUNIX = genunix
|
|
62 |
GENUNIX_DIR = ../../$(GENUNIX)
|
|
63 |
GENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
|
|
64 |
|
|
65 |
CPU_DIR = .
|
|
66 |
CPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
|
|
67 |
|
|
68 |
PLAT_DIR = ../../platmod
|
|
69 |
PLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
|
|
70 |
|
|
71 |
LIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
|
|
72 |
|
|
73 |
CTFEXTRAOBJS = $(OBJS_DIR)/vers.o
|
|
74 |
|
|
75 |
#
|
|
76 |
# Include common rules.
|
|
77 |
#
|
|
78 |
include $(UTSBASE)/sun4u/starcat/Makefile.starcat
|
|
79 |
|
|
80 |
#
|
|
81 |
# Define targets
|
|
82 |
#
|
|
83 |
ALL_TARGET = $(UNIX_BIN)
|
|
84 |
LINT_TARGET = $(LINT_LIB)
|
|
85 |
INSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE)
|
|
86 |
|
|
87 |
#
|
|
88 |
# Overrides
|
|
89 |
#
|
|
90 |
ALL_BUILDS = $(ALL_BUILDSONLY64)
|
|
91 |
DEF_BUILDS = $(DEF_BUILDSONLY64)
|
|
92 |
SYM_BUILDS = $(DEF_BUILDSONLY64)
|
|
93 |
CLEANLINTFILES += $(LINT32_FILES)
|
|
94 |
|
|
95 |
#
|
|
96 |
# This is UNIX_DIR. Use a short path.
|
|
97 |
#
|
|
98 |
UNIX_DIR = .
|
|
99 |
|
|
100 |
#
|
|
101 |
# Overrides
|
|
102 |
#
|
|
103 |
CLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(OBJS_DIR)/vers.c \
|
|
104 |
$(OBJS_DIR)/vers.o $(CPU_OBJ) $(CPULIB) \
|
|
105 |
$(DTRACESTUBS_O) $(DTRACESTUBS)
|
|
106 |
|
|
107 |
CLOBBERFILES = $(CLEANFILES) $(UNIX_BIN)
|
|
108 |
CLEANLINTFILES += $(LINT_LIB)
|
|
109 |
|
|
110 |
#
|
|
111 |
# lint pass one enforcement
|
|
112 |
# Turn on doubleword alignment for 64 bit counter timer registers
|
|
113 |
#
|
|
114 |
CFLAGS += $(CCVERBOSE) -dalign
|
|
115 |
|
|
116 |
#
|
|
117 |
# Default build targets.
|
|
118 |
#
|
|
119 |
.KEEP_STATE:
|
|
120 |
|
|
121 |
def: $(DEF_DEPS)
|
|
122 |
|
|
123 |
all: $(ALL_DEPS)
|
|
124 |
|
|
125 |
clean: $(CLEAN_DEPS)
|
|
126 |
|
|
127 |
clobber: $(CLOBBER_DEPS)
|
|
128 |
|
|
129 |
lint: $(LINT_DEPS)
|
|
130 |
|
|
131 |
clean.lint: $(CLEAN_LINT_DEPS)
|
|
132 |
|
|
133 |
install: $(INSTALL_DEPS)
|
|
134 |
|
|
135 |
symcheck: $(SYM_DEPS)
|
|
136 |
|
|
137 |
$(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) $(DTRACESTUBS)
|
|
138 |
$(LD) -dy -b -o $@ -e _start -I $(KRTLD) -M $(MAPFILE) \
|
|
139 |
$(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
|
|
140 |
$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
|
|
141 |
$(POST_PROCESS)
|
|
142 |
|
|
143 |
symcheck.targ: $(UNIX_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS)
|
|
144 |
$(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
|
|
145 |
$(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
|
|
146 |
|
|
147 |
#$(UNIX).glom: $(UNIX)
|
|
148 |
# ${LD} -dy -b -z nodefs -o $@ -e _start -I $(KRTLD) -M $(MAPFILE) \
|
|
149 |
# $(UNIX_O) $(MODSTUBS_O) $(GENUNIX_DIR)/$(GENUNIX)
|
|
150 |
# $(POST_PROCESS)
|
|
151 |
|
|
152 |
$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
|
|
153 |
$(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
|
|
154 |
|
|
155 |
#
|
|
156 |
# Special rules for generating assym.h for inclusion in assembly files.
|
|
157 |
#
|
|
158 |
$(DSF_DIR)/$(OBJS_DIR)/assym.h: FRC
|
|
159 |
@cd $(DSF_DIR); $(MAKE) all.targ
|
|
160 |
|
|
161 |
$(GENLIB): FRC
|
|
162 |
@(cd $(GENLIB_DIR); pwd; $(MAKE) all.targ)
|
|
163 |
@pwd
|
|
164 |
|
|
165 |
$(PLATLIB):
|
|
166 |
?@(cd $(PLAT_DIR); pwd; $(MAKE) all.targ)
|
|
167 |
?@pwd
|
|
168 |
#
|
|
169 |
# CPU_OBJ now comprises of 2 object files which come from sun4 common
|
|
170 |
# and from architecture dependent code. OBJS_DIR is prepended where
|
|
171 |
# CPU_DIR is defined to allow for building multiple CPU_OBJ's
|
|
172 |
#
|
|
173 |
$(CPULIB): $(CPU_OBJ)
|
580
|
174 |
$(BUILD.SO) $(CPU_OBJ)
|
0
|
175 |
|
|
176 |
#
|
|
177 |
# The global lint target builds the kernel lint library (llib-lunix.ln)
|
|
178 |
# which is equivalent to a lint of /unix.o. Then all kernel modules for
|
|
179 |
# this architecture are linted against the kernel lint library.
|
|
180 |
#
|
|
181 |
# Note: lint errors in the kernel lint library will be repeated for
|
|
182 |
# each module. It is important that the kernel lint library
|
|
183 |
# be clean to keep the textual output to a reasonable level.
|
|
184 |
#
|
|
185 |
|
|
186 |
$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
|
|
187 |
@-$(ECHO) "\n$(UNIX): (library construction):"
|
|
188 |
@$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS)
|
|
189 |
@$(MV) $(@F) $@
|
|
190 |
|
|
191 |
lintlib: $(LINT_DEPS)
|
|
192 |
|
|
193 |
#
|
|
194 |
# Include common targets.
|
|
195 |
#
|
|
196 |
include $(UTSBASE)/sun4u/starcat/Makefile.targ
|