1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gate# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate#
26*7c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate# psm/stand/lib/promif/sparcv9/ieee1275/common/Makefile
29*7c478bd9Sstevel@tonic-gate#
30*7c478bd9Sstevel@tonic-gate
31*7c478bd9Sstevel@tonic-gate# usr/src
32*7c478bd9Sstevel@tonic-gateTOPDIR =	../../../../../../..
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/Makefile.master
35*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/lib/Makefile.lib
36*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/psm/stand/lib/Makefile.lib
37*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/psm/Makefile.psm.64
38*7c478bd9Sstevel@tonic-gate
39*7c478bd9Sstevel@tonic-gateCFLAGS64	+= -xchip=ultra $(CCABS32)
40*7c478bd9Sstevel@tonic-gate
41*7c478bd9Sstevel@tonic-gatePROMDIR =	$(TOPDIR)/psm/promif/ieee1275/common
42*7c478bd9Sstevel@tonic-gateSYSDIR =	$(TOPDIR)/uts
43*7c478bd9Sstevel@tonic-gate
44*7c478bd9Sstevel@tonic-gateLIBPROM =	libprom.a
45*7c478bd9Sstevel@tonic-gateLINTLIBPROM =	llib-lprom.ln
46*7c478bd9Sstevel@tonic-gate
47*7c478bd9Sstevel@tonic-gatePROM_CFILES =			\
48*7c478bd9Sstevel@tonic-gate	prom_2path.c		\
49*7c478bd9Sstevel@tonic-gate	prom_boot.c		\
50*7c478bd9Sstevel@tonic-gate	prom_devname.c		\
51*7c478bd9Sstevel@tonic-gate	prom_devtype.c		\
52*7c478bd9Sstevel@tonic-gate	prom_enter.c		\
53*7c478bd9Sstevel@tonic-gate	prom_env.c		\
54*7c478bd9Sstevel@tonic-gate	prom_exit.c		\
55*7c478bd9Sstevel@tonic-gate	prom_fb.c		\
56*7c478bd9Sstevel@tonic-gate	prom_getchar.c		\
57*7c478bd9Sstevel@tonic-gate	prom_gettime.c		\
58*7c478bd9Sstevel@tonic-gate	prom_handler.c		\
59*7c478bd9Sstevel@tonic-gate	prom_inpath.c		\
60*7c478bd9Sstevel@tonic-gate	prom_interp.c		\
61*7c478bd9Sstevel@tonic-gate	prom_io.c		\
62*7c478bd9Sstevel@tonic-gate	prom_kbd.c		\
63*7c478bd9Sstevel@tonic-gate	prom_key.c		\
64*7c478bd9Sstevel@tonic-gate	prom_node.c		\
65*7c478bd9Sstevel@tonic-gate	prom_outpath.c		\
66*7c478bd9Sstevel@tonic-gate	prom_panic.c		\
67*7c478bd9Sstevel@tonic-gate	prom_path.c		\
68*7c478bd9Sstevel@tonic-gate	prom_phandle.c		\
69*7c478bd9Sstevel@tonic-gate	prom_printf.c		\
70*7c478bd9Sstevel@tonic-gate	prom_prop.c		\
71*7c478bd9Sstevel@tonic-gate	prom_putchar.c		\
72*7c478bd9Sstevel@tonic-gate	prom_reboot.c		\
73*7c478bd9Sstevel@tonic-gate	prom_stdin.c		\
74*7c478bd9Sstevel@tonic-gate	prom_stdout.c		\
75*7c478bd9Sstevel@tonic-gate	prom_string.c		\
76*7c478bd9Sstevel@tonic-gate	prom_test.c		\
77*7c478bd9Sstevel@tonic-gate	prom_trap.c		\
78*7c478bd9Sstevel@tonic-gate	prom_version.c		\
79*7c478bd9Sstevel@tonic-gate	prom_wrtestr.c
80*7c478bd9Sstevel@tonic-gate
81*7c478bd9Sstevel@tonic-gatePROM_SFILES =
82*7c478bd9Sstevel@tonic-gate
83*7c478bd9Sstevel@tonic-gatePROM_FILES = 	$(PROM_CFILES) $(PROM_SFILES)
84*7c478bd9Sstevel@tonic-gate
85*7c478bd9Sstevel@tonic-gateKARCH =		sun4u
86*7c478bd9Sstevel@tonic-gateMMU =		sfmmu
87*7c478bd9Sstevel@tonic-gate
88*7c478bd9Sstevel@tonic-gateOBJSDIR =	objs
89*7c478bd9Sstevel@tonic-gate
90*7c478bd9Sstevel@tonic-gatePROM_COBJ =	$(PROM_CFILES:%.c=$(OBJSDIR)/%.o)
91*7c478bd9Sstevel@tonic-gatePROM_SOBJ =	$(PROM_SFILES:%.s=$(OBJSDIR)/%.o)
92*7c478bd9Sstevel@tonic-gateOBJS =		$(PROM_COBJ) $(PROM_SOBJ)
93*7c478bd9Sstevel@tonic-gateL_OBJS =	$(OBJS:%.o=%.ln)
94*7c478bd9Sstevel@tonic-gateL_SRCS =	$(PROM_FILES:%=$(PROMDIR)/%)
95*7c478bd9Sstevel@tonic-gate
96*7c478bd9Sstevel@tonic-gateARCHOPTS =	-DSTACK_64BIT -Dsun4u
97*7c478bd9Sstevel@tonic-gateASFLAGS =	-P -D__STDC__ -D_BOOT -D_ASM
98*7c478bd9Sstevel@tonic-gateCPPDEFS	=	$(ARCHOPTS) -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
99*7c478bd9Sstevel@tonic-gateCPPINCS =	-I. -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) -I$(SYSDIR)/$(MMU) \
100*7c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sparc/v9 -I$(SYSDIR)/sparc \
101*7c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sun -I$(SYSDIR)/common
102*7c478bd9Sstevel@tonic-gateCPPFLAGS =	$(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
103*7c478bd9Sstevel@tonic-gateCFLAGS +=	$(CCVERBOSE)
104*7c478bd9Sstevel@tonic-gate
105*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
106*7c478bd9Sstevel@tonic-gate
107*7c478bd9Sstevel@tonic-gate.PARALLEL:	$(OBJS) $(L_OBJS)
108*7c478bd9Sstevel@tonic-gate
109*7c478bd9Sstevel@tonic-gateall install: $(LIBPROM)
110*7c478bd9Sstevel@tonic-gate
111*7c478bd9Sstevel@tonic-gatelint: $(LINTLIBPROM)
112*7c478bd9Sstevel@tonic-gate
113*7c478bd9Sstevel@tonic-gateclean:
114*7c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(L_OBJS)
115*7c478bd9Sstevel@tonic-gate
116*7c478bd9Sstevel@tonic-gateclobber: clean
117*7c478bd9Sstevel@tonic-gate	$(RM) $(LIBPROM) $(LINTLIBPROM) a.out core
118*7c478bd9Sstevel@tonic-gate
119*7c478bd9Sstevel@tonic-gate$(LIBPROM): $(OBJSDIR) .WAIT $(OBJS)
120*7c478bd9Sstevel@tonic-gate	$(BUILD.AR) $(OBJS)
121*7c478bd9Sstevel@tonic-gate
122*7c478bd9Sstevel@tonic-gate$(LINTLIBPROM): $(OBJSDIR) .WAIT $(L_OBJS)
123*7c478bd9Sstevel@tonic-gate	@$(ECHO) "\nlint library construction:" $@
124*7c478bd9Sstevel@tonic-gate	@$(LINT.lib) -o prom $(L_SRCS)
125*7c478bd9Sstevel@tonic-gate
126*7c478bd9Sstevel@tonic-gate$(OBJSDIR):
127*7c478bd9Sstevel@tonic-gate	-@[ -d $@ ] || mkdir $@
128*7c478bd9Sstevel@tonic-gate
129*7c478bd9Sstevel@tonic-gate#
130*7c478bd9Sstevel@tonic-gate# build rules using standard library object subdirectory
131*7c478bd9Sstevel@tonic-gate#
132*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PROMDIR)/%.c
133*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
134*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
135*7c478bd9Sstevel@tonic-gate
136*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PROMDIR)/%.s
137*7c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
138*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
139*7c478bd9Sstevel@tonic-gate
140*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PROMDIR)/%.c
141*7c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.c) $< $(LTAIL))
142*7c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
143*7c478bd9Sstevel@tonic-gate
144*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PROMDIR)/%.s
145*7c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.s) $< $(LTAIL))
146*7c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
147