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 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate#
26*7c478bd9Sstevel@tonic-gate# psm/stand/boot/sparcv9/ieee1275/sun4v/Makefile
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate#
29*7c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
30*7c478bd9Sstevel@tonic-gate#
31*7c478bd9Sstevel@tonic-gateTOPDIR =	../../../../../../..
32*7c478bd9Sstevel@tonic-gate
33*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/Makefile.master
34*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/lib/Makefile.lib
35*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/psm/stand/lib/Makefile.lib
36*7c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/psm/Makefile.psm.64
37*7c478bd9Sstevel@tonic-gate
38*7c478bd9Sstevel@tonic-gateCFLAGS64	+= -xchip=ultra $(CCABS32)
39*7c478bd9Sstevel@tonic-gate
40*7c478bd9Sstevel@tonic-gatePLATDIR =	$(TOPDIR)/psm/promif/ieee1275/sun4u
41*7c478bd9Sstevel@tonic-gatePLATSUN4DIR =	$(TOPDIR)/psm/promif/ieee1275/sun4
42*7c478bd9Sstevel@tonic-gateSYSDIR =	$(TOPDIR)/uts
43*7c478bd9Sstevel@tonic-gate
44*7c478bd9Sstevel@tonic-gateLIBPLAT =	libplat.a
45*7c478bd9Sstevel@tonic-gateLINTLIBPLAT =	llib-lplat.ln
46*7c478bd9Sstevel@tonic-gate
47*7c478bd9Sstevel@tonic-gatePLAT_PFILES = 			\
48*7c478bd9Sstevel@tonic-gate	prom_heartbeat.c	\
49*7c478bd9Sstevel@tonic-gate	prom_mmu.c		\
50*7c478bd9Sstevel@tonic-gate	prom_vercheck.c
51*7c478bd9Sstevel@tonic-gate
52*7c478bd9Sstevel@tonic-gatePLAT_PSUN4FILES =		\
53*7c478bd9Sstevel@tonic-gate	prom_alloc.c		\
54*7c478bd9Sstevel@tonic-gate	prom_cpuctl.c		\
55*7c478bd9Sstevel@tonic-gate	prom_getunum.c		\
56*7c478bd9Sstevel@tonic-gate	prom_idprom.c		\
57*7c478bd9Sstevel@tonic-gate	prom_init.c		\
58*7c478bd9Sstevel@tonic-gate	prom_macaddr.c		\
59*7c478bd9Sstevel@tonic-gate	prom_map.c		\
60*7c478bd9Sstevel@tonic-gate	prom_mem.c		\
61*7c478bd9Sstevel@tonic-gate	prom_retain.c		\
62*7c478bd9Sstevel@tonic-gate	prom_sparc.c
63*7c478bd9Sstevel@tonic-gate
64*7c478bd9Sstevel@tonic-gateKARCH =		sun4v
65*7c478bd9Sstevel@tonic-gateMMU =		sfmmu
66*7c478bd9Sstevel@tonic-gate
67*7c478bd9Sstevel@tonic-gateOBJSDIR =	objs
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gatePLAT_POBJ =	$(PLAT_PFILES:%.c=$(OBJSDIR)/%.o)
70*7c478bd9Sstevel@tonic-gatePLAT_PSUN4OBJ =	$(PLAT_PSUN4FILES:%.c=$(OBJSDIR)/%.o)
71*7c478bd9Sstevel@tonic-gateOBJS =		$(PLAT_POBJ) $(PLAT_PSUN4OBJ)
72*7c478bd9Sstevel@tonic-gateL_OBJS =	$(OBJS:%.o=%.ln)
73*7c478bd9Sstevel@tonic-gateL_SRCS = 	$(PLAT_PFILES:%=$(PLATDIR)/%)
74*7c478bd9Sstevel@tonic-gateL_SRCS += 	$(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%)
75*7c478bd9Sstevel@tonic-gate
76*7c478bd9Sstevel@tonic-gateARCHOPTS=	-Dsun4v
77*7c478bd9Sstevel@tonic-gateASFLAGS =	-P -D__STDC__ -D_BOOT -D_ASM
78*7c478bd9Sstevel@tonic-gateCPPDEFS	=	$(ARCHOPTS) -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
79*7c478bd9Sstevel@tonic-gateCPPINCS =	-I. -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) -I$(SYSDIR)/$(MMU) \
80*7c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sun4u \
81*7c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sparc/v9 -I$(SYSDIR)/sparc \
82*7c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sun -I$(SYSDIR)/common
83*7c478bd9Sstevel@tonic-gateCPPFLAGS=	$(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
84*7c478bd9Sstevel@tonic-gateCFLAGS +=	$(CCVERBOSE)
85*7c478bd9Sstevel@tonic-gate
86*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
87*7c478bd9Sstevel@tonic-gate
88*7c478bd9Sstevel@tonic-gate.PARALLEL:	$(OBJS) $(L_OBJS)
89*7c478bd9Sstevel@tonic-gate
90*7c478bd9Sstevel@tonic-gateall install: $(LIBPLAT)
91*7c478bd9Sstevel@tonic-gate
92*7c478bd9Sstevel@tonic-gatelint: $(LINTLIBPLAT)
93*7c478bd9Sstevel@tonic-gate
94*7c478bd9Sstevel@tonic-gateclean:
95*7c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(L_OBJS)
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gateclobber: clean
98*7c478bd9Sstevel@tonic-gate	$(RM) $(LIBPLAT) $(LINTLIBPLAT) a.out core
99*7c478bd9Sstevel@tonic-gate
100*7c478bd9Sstevel@tonic-gate$(LIBPLAT): $(OBJSDIR) .WAIT $(OBJS)
101*7c478bd9Sstevel@tonic-gate	$(BUILD.AR) $(OBJS)
102*7c478bd9Sstevel@tonic-gate
103*7c478bd9Sstevel@tonic-gate$(LINTLIBPLAT): $(OBJSDIR) .WAIT $(L_OBJS)
104*7c478bd9Sstevel@tonic-gate	@$(ECHO) "\nlint library construction:" $@
105*7c478bd9Sstevel@tonic-gate	@$(LINT.lib) -o plat $(L_SRCS)
106*7c478bd9Sstevel@tonic-gate
107*7c478bd9Sstevel@tonic-gate$(OBJSDIR):
108*7c478bd9Sstevel@tonic-gate	-@[ -d $@ ] || mkdir $@
109*7c478bd9Sstevel@tonic-gate
110*7c478bd9Sstevel@tonic-gate#
111*7c478bd9Sstevel@tonic-gate# build rules using standard library object subdirectory
112*7c478bd9Sstevel@tonic-gate#
113*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATDIR)/%.c
114*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
115*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
116*7c478bd9Sstevel@tonic-gate
117*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATDIR)/%.s
118*7c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
119*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
120*7c478bd9Sstevel@tonic-gate
121*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.c
122*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
123*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
124*7c478bd9Sstevel@tonic-gate
125*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.s
126*7c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
127*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
128*7c478bd9Sstevel@tonic-gate
129*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATDIR)/%.c
130*7c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.c) $< $(LTAIL))
131*7c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
132*7c478bd9Sstevel@tonic-gate
133*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATDIR)/%.s
134*7c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.s) $< $(LTAIL))
135*7c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
136*7c478bd9Sstevel@tonic-gate
137*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.c
138*7c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.c) $< $(LTAIL))
139*7c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
140*7c478bd9Sstevel@tonic-gate
141*7c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.s
142*7c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.s) $< $(LTAIL))
143*7c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
144