xref: /titanic_41/usr/src/uts/sun4u/opl/Makefile.rules (revision d89fccd8788afe1e920f842edd883fe192a1b8fe)
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 (the "License").
6# You may not use this file except in compliance with the License.
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#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27#	This Makefile defines the build rules for the directory
28#	uts/sun4u/opl and its children.
29#
30# uts/sun4u/opl/Makefile.rules
31#
32
33#
34#	Section 1a: C object build rules
35#
36
37#
38# inline support for DR.
39#
40
41
42$(OBJS_DIR)/dr_mem.o:		$(UTSBASE)/sun4u/opl/io/dr_mem.c
43	$(COMPILE.c) -o $@ $(UTSBASE)/sun4u/opl/io/dr_mem.c
44	$(CTFCONVERT_O)
45
46$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/ngdr/io/%.c
47	$(COMPILE.c) -o $@ $<
48	$(CTFCONVERT_O)
49
50DR_IO=	$(UTSBASE)/sun4u/ngdr/io
51SBD_IOCTL=	$(UTSBASE)/sun4u/sys/sbd_ioctl.h
52SBDGENERR=	$(DR_IO)/sbdgenerr
53
54CLEANFILES +=	$(SBDGENERR)
55CLEANFILES +=	$(DR_IO)/dr_err.c
56
57$(DR_IO)/dr_err.c:	$(SBDGENERR) $(SBD_IOCTL)
58	$(RM) $@
59	$(SBDGENERR) ESBD < $(SBD_IOCTL) > $(DR_IO)/dr_err.c
60
61$(SBDGENERR):			$(DR_IO)/sbdgenerr.pl
62	$(RM) $@
63	$(CAT) $(DR_IO)/sbdgenerr.pl > $@
64	$(CHMOD) +x $@
65
66IL_CPP=$(CPP) -P -DINLINE -D_ASM $(AS_INC_PATH) \
67        $(CPP_DEFS) $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS)
68
69DRMACH_IL=              $(OBJS_DIR)/drmach.il
70$(OBJS_DIR)/drmach.o    := CC_XARCH_32 = -xarch=v8plusa
71$(OBJS_DIR)/drmach.o:   $(UTSBASE)/sun4u/opl/io/drmach.c $(DRMACH_IL)
72	$(COMPILE.c) $(DRMACH_IL) -o $@ $(UTSBASE)/sun4u/opl/io/drmach.c
73	$(CTFCONVERT_O)
74
75$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/%.c
76	$(COMPILE.c) -o $@ $<
77	$(CTFCONVERT_O)
78
79$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/pcicmu/%.c
80	$(COMPILE.c) -o $@ $<
81	$(CTFCONVERT_O)
82
83$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/ml/%.s
84	$(COMPILE.s) -o $@ $<
85
86$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/os/%.c
87	$(COMPILE.c) -o $@ $<
88	$(CTFCONVERT_O)
89
90$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/oplpanel/%.c
91	$(COMPILE.c) -o $@ $<
92	$(CTFCONVERT_O)
93
94$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/scfd/%.c
95	$(COMPILE.c) -o $@ $<
96	$(CTFCONVERT_O)
97
98$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/oplmsu/%.c
99	$(COMPILE.c) -o $@ $<
100	$(CTFCONVERT_O)
101
102OPL_IO=       $(UTSBASE)/sun4u/opl/io
103
104CLEANFILES +=   $(OPL_IO)/drmach_err.c
105
106$(OPL_IO)/drmach_err.c: $(SBDGENERR) $(SBD_IOCTL)
107	$(RM) $@
108	$(SBDGENERR) EOPL < $(SBD_IOCTL) > $@
109
110CLEANFILES += $(DRMACH_IL)
111
112$(DRMACH_IL):   $(UTSBASE)/sun4u/opl/ml/drmach.il.cpp
113	$(IL_CPP) $(UTSBASE)/sun4u/opl/ml/drmach.il.cpp > $@
114
115
116#
117#	Section 1b: Lint object build rules
118#
119
120$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/ngdr/io/%.c
121	@($(LHEAD) $(LINT.c) $< $(LTAIL))
122
123$(LINTS_DIR)/dr_mem.ln:		$(UTSBASE)/sun4u/opl/io/dr_mem.c
124	@($(LHEAD) $(LINT.c) $(UTSBASE)/sun4u/opl/io/dr_mem.c $(LTAIL))
125
126$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/%.c
127	@($(LHEAD) $(LINT.c) $< $(LTAIL))
128
129$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/pcicmu/%.c
130	@($(LHEAD) $(LINT.c) $< $(LTAIL))
131
132$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/ml/%.s
133	@($(LHEAD) $(LINT.s) $< $(LTAIL))
134
135$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/os/%.c
136	@($(LHEAD) $(LINT.c) $< $(LTAIL))
137
138$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/oplpanel/%.c
139	@($(LHEAD) $(LINT.c) $< $(LTAIL))
140
141$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/scfd/%.c
142	@($(LHEAD) $(LINT.c) $< $(LTAIL))
143
144$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/oplmsu/%.c
145	@($(LHEAD) $(LINT.c) $< $(LTAIL))
146
147.KEEP_STATE:
148