17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5986fd29aSsetje# Common Development and Distribution License (the "License").
6986fd29aSsetje# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22d24234c2SJerry Gilliam# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
24*9cb0a1d4SPeter Tribble# Copyright 2019 Peter Tribble.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate# psm/stand/boot/sparcv9/ieee1275/sun4u/Makefile
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate#
297c478bd9Sstevel@tonic-gateTOPDIR =	../../../../../../..
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/Makefile.master
327c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/lib/Makefile.lib
337c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/psm/stand/lib/Makefile.lib
347c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/psm/Makefile.psm.64
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gateCFLAGS64	+= -xchip=ultra $(CCABS32)
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gatePLATDIR =	$(TOPDIR)/psm/promif/ieee1275/sun4u
397c478bd9Sstevel@tonic-gatePLATSUN4DIR =	$(TOPDIR)/psm/promif/ieee1275/sun4
407c478bd9Sstevel@tonic-gateSYSDIR =	$(TOPDIR)/uts
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateLIBPLAT =	libplat.a
437c478bd9Sstevel@tonic-gateLINTLIBPLAT =	llib-lplat.ln
447c478bd9Sstevel@tonic-gate
45*9cb0a1d4SPeter TribblePLAT_PFILES =			\
467c478bd9Sstevel@tonic-gate	prom_serengeti.c	\
477c478bd9Sstevel@tonic-gate	prom_sunfire.c		\
48d24234c2SJerry Gilliam	prom_tlb.c
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gatePLAT_PSUN4FILES =		\
517c478bd9Sstevel@tonic-gate	prom_alloc.c		\
527c478bd9Sstevel@tonic-gate	prom_cpuctl.c		\
53986fd29aSsetje	prom_fio.c		\
547c478bd9Sstevel@tonic-gate	prom_getunum.c		\
55d24234c2SJerry Gilliam	prom_heartbeat.c	\
567c478bd9Sstevel@tonic-gate	prom_idprom.c		\
577c478bd9Sstevel@tonic-gate	prom_init.c		\
587c478bd9Sstevel@tonic-gate	prom_macaddr.c		\
597c478bd9Sstevel@tonic-gate	prom_map.c		\
607c478bd9Sstevel@tonic-gate	prom_mem.c		\
61d24234c2SJerry Gilliam	prom_mmu.c		\
627c478bd9Sstevel@tonic-gate	prom_retain.c		\
63986fd29aSsetje	prom_sparc.c		\
64986fd29aSsetje	prom_vername.c
657c478bd9Sstevel@tonic-gate
667c478bd9Sstevel@tonic-gateKARCH =		sun4u
677c478bd9Sstevel@tonic-gateMMU =		sfmmu
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gateOBJSDIR =	objs
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gatePLAT_POBJ =	$(PLAT_PFILES:%.c=$(OBJSDIR)/%.o)
727c478bd9Sstevel@tonic-gatePLAT_PSUN4OBJ =	$(PLAT_PSUN4FILES:%.c=$(OBJSDIR)/%.o)
737c478bd9Sstevel@tonic-gateOBJS =		$(PLAT_POBJ) $(PLAT_PSUN4OBJ)
747c478bd9Sstevel@tonic-gateL_OBJS =	$(OBJS:%.o=%.ln)
75*9cb0a1d4SPeter TribbleL_SRCS =	$(PLAT_PFILES:%=$(PLATDIR)/%)
76*9cb0a1d4SPeter TribbleL_SRCS +=	$(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%)
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gateARCHOPTS=	-Dsun4u
797c478bd9Sstevel@tonic-gateASFLAGS =	-P -D__STDC__ -D_BOOT -D_ASM
807c478bd9Sstevel@tonic-gateCPPDEFS	=	$(ARCHOPTS) -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
817c478bd9Sstevel@tonic-gateCPPINCS =	-I. -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) -I$(SYSDIR)/$(MMU) \
827c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sparc/v9 -I$(SYSDIR)/sparc \
837c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sun -I$(SYSDIR)/common
847c478bd9Sstevel@tonic-gateCPPFLAGS=	$(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
857c478bd9Sstevel@tonic-gateCFLAGS +=	$(CCVERBOSE)
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate.KEEP_STATE:
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gate.PARALLEL:	$(OBJS) $(L_OBJS)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gateall install: $(LIBPLAT)
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gatelint: $(LINTLIBPLAT)
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gateclean:
967c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(L_OBJS)
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gateclobber: clean
99b6805bf7SGordon Ross	$(RM) $(LIBPLAT) $(LINTLIBPLAT)
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate$(LIBPLAT): $(OBJSDIR) .WAIT $(OBJS)
1027c478bd9Sstevel@tonic-gate	$(BUILD.AR) $(OBJS)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate$(LINTLIBPLAT): $(OBJSDIR) .WAIT $(L_OBJS)
1057c478bd9Sstevel@tonic-gate	@$(ECHO) "\nlint library construction:" $@
1067c478bd9Sstevel@tonic-gate	@$(LINT.lib) -o plat $(L_SRCS)
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gate$(OBJSDIR):
1097c478bd9Sstevel@tonic-gate	-@[ -d $@ ] || mkdir $@
1107c478bd9Sstevel@tonic-gate
1117c478bd9Sstevel@tonic-gate#
1127c478bd9Sstevel@tonic-gate# build rules using standard library object subdirectory
1137c478bd9Sstevel@tonic-gate#
1147c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATDIR)/%.c
1157c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1167c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATDIR)/%.s
1197c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1207c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1217c478bd9Sstevel@tonic-gate
1227c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.c
1237c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1247c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.s
1277c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1287c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATDIR)/%.c
1317c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.c) $< $(LTAIL))
1327c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
1337c478bd9Sstevel@tonic-gate
1347c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATDIR)/%.s
1357c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.s) $< $(LTAIL))
1367c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.c
1397c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.c) $< $(LTAIL))
1407c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gate$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.s
1437c478bd9Sstevel@tonic-gate	@($(LHEAD) $(LINT.s) $< $(LTAIL))
1447c478bd9Sstevel@tonic-gate	@$(MV) $(@F) $@
145