xref: /titanic_50/usr/src/uts/sun4u/opl/Makefile.rules (revision 3d729aecc03ea6ebb9bd5d56b8dccd24f57daa41)
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
31#
32#	Section 1a: C object build rules
33#
34
35#
36# inline support for DR.
37#
38
39
40$(OBJS_DIR)/dr_mem.o:		$(UTSBASE)/sun4u/opl/io/dr_mem.c
41	$(COMPILE.c) -o $@ $(UTSBASE)/sun4u/opl/io/dr_mem.c
42	$(CTFCONVERT_O)
43
44$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/ngdr/io/%.c
45	$(COMPILE.c) -o $@ $<
46	$(CTFCONVERT_O)
47
48DR_IO=	$(UTSBASE)/sun4u/ngdr/io
49SBD_IOCTL=	$(UTSBASE)/sun4u/sys/sbd_ioctl.h
50SBDGENERR=	$(DR_IO)/sbdgenerr
51
52CLEANFILES +=	$(SBDGENERR)
53CLEANFILES +=	$(DR_IO)/dr_err.c
54
55$(DR_IO)/dr_err.c:	$(SBDGENERR) $(SBD_IOCTL)
56	$(RM) $@
57	$(SBDGENERR) ESBD < $(SBD_IOCTL) > $(DR_IO)/dr_err.c
58
59$(SBDGENERR):			$(DR_IO)/sbdgenerr.pl
60	$(RM) $@
61	$(CAT) $(DR_IO)/sbdgenerr.pl > $@
62	$(CHMOD) +x $@
63
64IL_CPP=$(CPP) -P -DINLINE -D_ASM $(AS_INC_PATH) \
65        $(CPP_DEFS) $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS)
66
67DRMACH_IL=              $(OBJS_DIR)/drmach.il
68$(OBJS_DIR)/drmach.o    := CC_XARCH_32 = -xarch=v8plusa
69$(OBJS_DIR)/drmach.o:   $(UTSBASE)/sun4u/opl/io/drmach.c $(DRMACH_IL)
70	$(COMPILE.c) $(DRMACH_IL) -o $@ $(UTSBASE)/sun4u/opl/io/drmach.c
71	$(CTFCONVERT_O)
72
73$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/%.c
74	$(COMPILE.c) -o $@ $<
75	$(CTFCONVERT_O)
76
77$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/pcicmu/%.c
78	$(COMPILE.c) -o $@ $<
79	$(CTFCONVERT_O)
80
81$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/ml/%.s
82	$(COMPILE.s) -o $@ $<
83
84$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/os/%.c
85	$(COMPILE.c) -o $@ $<
86	$(CTFCONVERT_O)
87
88$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/oplpanel/%.c
89	$(COMPILE.c) -o $@ $<
90	$(CTFCONVERT_O)
91
92$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/opl/io/oplmsu/%.c
93	$(COMPILE.c) -o $@ $<
94	$(CTFCONVERT_O)
95
96OPL_IO=       $(UTSBASE)/sun4u/opl/io
97
98CLEANFILES +=   $(OPL_IO)/drmach_err.c
99
100$(OPL_IO)/drmach_err.c: $(SBDGENERR) $(SBD_IOCTL)
101	$(RM) $@
102	$(SBDGENERR) EOPL < $(SBD_IOCTL) > $@
103
104CLEANFILES += $(DRMACH_IL)
105
106$(DRMACH_IL):   $(UTSBASE)/sun4u/opl/ml/drmach.il.cpp
107	$(IL_CPP) $(UTSBASE)/sun4u/opl/ml/drmach.il.cpp > $@
108
109
110#
111#	Section 1b: Lint object build rules
112#
113
114$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/ngdr/io/%.c
115	@($(LHEAD) $(LINT.c) $< $(LTAIL))
116
117$(LINTS_DIR)/dr_mem.ln:		$(UTSBASE)/sun4u/opl/io/dr_mem.c
118	@($(LHEAD) $(LINT.c) $(UTSBASE)/sun4u/opl/io/dr_mem.c $(LTAIL))
119
120$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/%.c
121	@($(LHEAD) $(LINT.c) $< $(LTAIL))
122
123$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/pcicmu/%.c
124	@($(LHEAD) $(LINT.c) $< $(LTAIL))
125
126$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/ml/%.s
127	@($(LHEAD) $(LINT.s) $< $(LTAIL))
128
129$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/os/%.c
130	@($(LHEAD) $(LINT.c) $< $(LTAIL))
131
132$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/oplpanel/%.c
133	@($(LHEAD) $(LINT.c) $< $(LTAIL))
134
135$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/opl/io/oplmsu/%.c
136	@($(LHEAD) $(LINT.c) $< $(LTAIL))
137
138.KEEP_STATE:
139