xref: /titanic_51/usr/src/uts/sun4v/Makefile.rules (revision 43a291055ab3951f6372241323fd4e2486098fff)
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 defines the build rules for the directory uts/sun4v
29#	and its children. These are the source files which sun4v
30#	"implementation architecture" dependent.
31#
32#	The following two-level ordering must be maintained in this file.
33#	  Lines are sorted first in order of decreasing specificity based on
34#	  the first directory component.  That is, sun4v rules come before
35#	  sparc rules come before common rules.
36#
37#	  Lines whose initial directory components are equal are sorted
38#	  alphabetically by the remaining components.
39
40#
41#	Section 1a: C object build rules
42#
43$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/cpu/%.c
44	$(COMPILE.c) -o $@ $<
45	$(CTFCONVERT_O)
46
47$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/cpu/%.s
48	$(COMPILE.s) -o $@ $<
49
50$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/io/%.c
51	$(COMPILE.c) -o $@ $<
52	$(CTFCONVERT_O)
53
54$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/ml/%.s
55	$(COMPILE.s) -o $@ $<
56
57$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/os/%.c
58	$(COMPILE.c) -o $@ $<
59	$(CTFCONVERT_O)
60
61$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/pcbe/%.c
62	$(COMPILE.c) -o $@ $<
63	$(CTFCONVERT_O)
64
65$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/io/px/%.c
66	$(COMPILE.c) -o $@ $<
67	$(CTFCONVERT_O)
68
69$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/io/ncp/%.c
70	$(COMPILE.c) -o $@ $<
71	$(CTFCONVERT_O)
72
73$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/vm/%.c
74	$(COMPILE.c) -o $@ $<
75	$(CTFCONVERT_O)
76
77$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4v/vm/%.s
78	$(COMPILE.s) -o $@ $<
79
80$(OBJS_DIR)/%.o:		$(UTSBASE)/sfmmu/ml/%.s
81	$(COMPILE.s) -o $@ $<
82
83$(OBJS_DIR)/%.o:		$(UTSBASE)/sfmmu/vm/%.c
84	$(COMPILE.c) -o $@ $<
85	$(CTFCONVERT_O)
86
87$(OBJS_DIR)/%.o:		$(UTSBASE)/sparc/os/%.c
88	$(COMPILE.c) -o $@ $<
89	$(CTFCONVERT_O)
90
91$(OBJS_DIR)/%.o:		$(UTSBASE)/common/os/%.c
92	$(COMPILE.c) -o $@ $<
93	$(CTFCONVERT_O)
94
95$(OBJS_DIR)/%.o:		$(SRC)/common/mdesc/%.c
96	$(COMPILE.c) -o $@ $<
97	$(CTFCONVERT_O)
98
99$(OBJS_DIR)/%.o:		$(SRC)/common/atomic/sparcv9/%.s
100	$(COMPILE.s) -o $@ $<
101
102$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/arcfour/sun4v/%.c
103	$(COMPILE.c) -o $@ $<
104	$(CTFCONVERT_O)
105
106$(OBJS_DIR)/dtracestubs.s:	$(UNIX_O) $(LIBS)
107	nm -u $(UNIX_O) $(LIBS) | grep __dtrace_probe_ | sort | uniq | nawk '{ \
108	    printf("\t.global %s\n\t.type %s, #function\n%s:\n", \
109	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
110
111$(DTRACESTUBS):	$(DTRACESTUBS_O)
112	$(LD) -o $@ -G -h dtracestubs $(DTRACESTUBS_O)
113
114#
115#	Section 1b: Lint `object' build rules
116#
117$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/cpu/%.c
118	@($(LHEAD) $(LINT.c) $< $(LTAIL))
119
120$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/cpu/%.s
121	@($(LHEAD) $(LINT.s) $< $(LTAIL))
122
123$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/io/%.c
124	@($(LHEAD) $(LINT.c) $< $(LTAIL))
125
126$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/io/px/%.c
127	@($(LHEAD) $(LINT.c) $< $(LTAIL))
128
129$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/io/ncp/%.c
130	@($(LHEAD) $(LINT.c) $< $(LTAIL))
131
132$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/ml/%.s
133	@($(LHEAD) $(LINT.s) $< $(LTAIL))
134
135$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/os/%.c
136	@($(LHEAD) $(LINT.c) $< $(LTAIL))
137
138$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/pcbe/%.c
139	@($(LHEAD) $(LINT.c) $< $(LTAIL))
140
141$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/vm/%.c
142	@($(LHEAD) $(LINT.c) $< $(LTAIL))
143
144$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4v/vm/%.s
145	@($(LHEAD) $(LINT.s) $< $(LTAIL))
146
147$(LINTS_DIR)/%.ln:		$(UTSBASE)/sfmmu/ml/%.s
148	@($(LHEAD) $(LINT.s) $< $(LTAIL))
149
150$(LINTS_DIR)/%.ln:		$(UTSBASE)/sfmmu/vm/%.c
151	@($(LHEAD) $(LINT.c) $< $(LTAIL))
152
153$(LINTS_DIR)/%.ln:		$(UTSBASE)/sparc/os/%.c
154	@($(LHEAD) $(LINT.c) $< $(LTAIL))
155
156$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/os/%.c
157	@($(LHEAD) $(LINT.c) $< $(LTAIL))
158
159$(LINTS_DIR)/%.ln:		$(SRC)/common/mdesc/%.c
160	@($(LHEAD) $(LINT.c) $< $(LTAIL))
161
162$(LINTS_DIR)/%.ln:		$(SRC)/common/atomic/%.c
163	@($(LHEAD) $(LINT.c) $< $(LTAIL))
164