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#
21d24234c2SJerry Gilliam# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
227c478bd9Sstevel@tonic-gate# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate# psm/stand/boot/sparcv9/Makefile.com
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateinclude $(TOPDIR)/psm/stand/boot/Makefile.boot
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateTARG_MACH	= sparcv9
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateBOOTSRCDIR	= ../..
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gateTOP_CMN_DIR	= $(SRC)/common
347c478bd9Sstevel@tonic-gateCMN_DIR		= $(BOOTSRCDIR)/common
357c478bd9Sstevel@tonic-gateMACH_DIR	= ../../sparc/common
36d24234c2SJerry GilliamPLAT_DIR	= sun4
3753391bafSeotaBOOT_DIR        = $(SRC)/psm/stand/boot
387c478bd9Sstevel@tonic-gate
39d24234c2SJerry GilliamNFSBOOT		= inetboot
40d24234c2SJerry Gilliam
41d24234c2SJerry GilliamNFSBOOT_SRC	= $(NFSBOOT).c
427c478bd9Sstevel@tonic-gate
43bf5d9f18SAndy FiddamanCONF_SRC	= nfsconf.c
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateTOP_CMN_C_SRC	= getoptstr.c
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateMISC_SRC	= ramdisk.c
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gateCMN_C_SRC	= heap_kmem.c readfile.c
507c478bd9Sstevel@tonic-gate
51986fd29aSsetjeMACH_C_SRC	= boot_plat.c bootops.c bootprop.c bootflags.c
52d24234c2SJerry GilliamMACH_C_SRC	+= machdep.c sun4u_machdep.c sun4v_machdep.c
537c478bd9Sstevel@tonic-gateMACH_C_SRC	+= get.c
547c478bd9Sstevel@tonic-gate
55d24234c2SJerry GilliamNFSBOOT_OBJS	= $(NFSBOOT_SRC:%.c=%.o)
56d24234c2SJerry GilliamNFSBOOT_L_OBJS	= $(NFSBOOT_OBJS:%.o=%.ln)
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gateCONF_OBJS	= $(CONF_SRC:%.c=%.o)
597c478bd9Sstevel@tonic-gateCONF_L_OBJS	= $(CONF_OBJS:%.o=%.ln)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gateMISC_OBJS	= $(MISC_SRC:%.c=%.o)
627c478bd9Sstevel@tonic-gateMISC_L_OBJS	= $(MISC_OBJS:%.o=%.ln)
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gateSRT0_OBJ	= $(SRT0_S:%.s=%.o)
657c478bd9Sstevel@tonic-gateSRT0_L_OBJ	= $(SRT0_OBJ:%.o=%.ln)
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gateC_SRC		= $(TOP_CMN_C_SRC) $(CMN_C_SRC) $(MACH_C_SRC) $(ARCH_C_SRC)
687c478bd9Sstevel@tonic-gateC_SRC		+= $(PLAT_C_SRC)
697c478bd9Sstevel@tonic-gateS_SRC		= $(MACH_S_SRC) $(ARCH_S_SRC) $(PLAT_S_SRC)
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gateOBJS		= $(C_SRC:%.c=%.o) $(S_SRC:%.s=%.o)
727c478bd9Sstevel@tonic-gateL_OBJS		= $(OBJS:%.o=%.ln)
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gateCPPDEFS		= $(ARCHOPTS) -D$(PLATFORM) -D_BOOT -D_KERNEL -D_MACHDEP
757c478bd9Sstevel@tonic-gateCPPDEFS		+= -D_ELF64_SUPPORT
767c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(TOP_CMN_DIR)
777c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/common
787c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sun
797c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sun4
807c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/$(PLATFORM)
817c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sparc/$(ARCHVERS)
827c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sparc
837c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/$(ARCHMMU)
847c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(ROOT)/usr/platform/$(PLATFORM)/include
857c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(ROOT)/usr/include/$(ARCHVERS)
867c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(PSMSYSHDRDIR)
877c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(STANDDIR)
887c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(STANDDIR)/lib
897c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(STANDDIR)/lib/sa
907c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/common/net/dhcp
9153391bafSeotaCPPINCS		+= -I$(BOOT_DIR)/sparc/common
927c478bd9Sstevel@tonic-gateCPPFLAGS	= $(CPPDEFS) $(CPPINCS)
937c478bd9Sstevel@tonic-gateCPPFLAGS	+= $(CCYFLAG)$(STANDDIR)
94*5d9d9091SRichard LoweASFLAGS		+= $(CPPDEFS) -D_ASM $(CPPINCS)
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gate#
97d24234c2SJerry Gilliam# Where to look for libraries.
987c478bd9Sstevel@tonic-gate#
997c478bd9Sstevel@tonic-gatePSMNAMELIBDIR	= $(PSMSTANDDIR)/lib/names/$(TARG_MACH)
1007c478bd9Sstevel@tonic-gatePSMPROMLIBDIR	= $(PSMSTANDDIR)/lib/promif/$(TARG_MACH)
1017c478bd9Sstevel@tonic-gate
102d24234c2SJerry Gilliam#
103d24234c2SJerry Gilliam# Install targets
104d24234c2SJerry Gilliam#
105d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB=$(USR_PLAT_DIR)/sun4u/lib
106d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB_FS=$(USR_PLAT_SUN4U_LIB)/fs
107d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB_FS_NFS=$(USR_PLAT_SUN4U_LIB_FS)/nfs
108d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB_FS_NFS_NFSBOOT=$(USR_PLAT_SUN4U_LIB_FS_NFS)/$(NFSBOOT)
109d24234c2SJerry Gilliam
110d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB=$(USR_PLAT_DIR)/sun4v/lib
111d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB_FS=$(USR_PLAT_SUN4V_LIB)/fs
112d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB_FS_NFS=$(USR_PLAT_SUN4V_LIB_FS)/nfs
113d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB_FS_NFS_NFSBOOT=$(USR_PLAT_SUN4V_LIB_FS_NFS)/$(NFSBOOT)
114d24234c2SJerry Gilliam
1157c478bd9Sstevel@tonic-gate#
1167c478bd9Sstevel@tonic-gate# The following libraries are built in LIBNAME_DIR
1177c478bd9Sstevel@tonic-gate#
1187c478bd9Sstevel@tonic-gateLIBNAME_DIR     += $(PSMNAMELIBDIR)/$(PLATFORM)
1197c478bd9Sstevel@tonic-gateLIBNAME_LIBS    += libnames.a
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gate#
1227c478bd9Sstevel@tonic-gate# The following libraries are built in LIBPROM_DIR
1237c478bd9Sstevel@tonic-gate#
1247c478bd9Sstevel@tonic-gateLIBPROM_DIR     += $(PSMPROMLIBDIR)/$(PROMVERS)/common
1257c478bd9Sstevel@tonic-gateLIBPROM_LIBS    += libprom.a
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate#
1287c478bd9Sstevel@tonic-gate# The following libraries are built in LIBSYS_DIR
1297c478bd9Sstevel@tonic-gate#
1307c478bd9Sstevel@tonic-gateLIBSYS_DIR      += $(SYSLIBDIR)
1317c478bd9Sstevel@tonic-gate
132d24234c2SJerry Gilliam#.KEEP_STATE:
1337c478bd9Sstevel@tonic-gate#
1347c478bd9Sstevel@tonic-gate
135d24234c2SJerry Gilliam.PARALLEL:	$(OBJS) $(CONF_OBJS) $(MISC_OBJS) $(SRT0_OBJ) \
136bf5d9f18SAndy Fiddaman		$(NFSBOOT_OBJS)
1377c478bd9Sstevel@tonic-gate.PARALLEL:	$(L_OBJS) $(CONF_L_OBJS) $(MISC_L_OBJS) $(SRT0_L_OBJ) \
138bf5d9f18SAndy Fiddaman		$(NFSBOOT_L_OBJS)
139bf5d9f18SAndy Fiddaman.PARALLEL:	$(NFSBOOT)
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gate#
1427c478bd9Sstevel@tonic-gate# Note that the presumption is that someone has already done a `make
1437c478bd9Sstevel@tonic-gate# install' from usr/src/stand/lib, such that all of the standalone
1447c478bd9Sstevel@tonic-gate# libraries have been built and placed in $ROOT/stand/lib.
1457c478bd9Sstevel@tonic-gate#
1467c478bd9Sstevel@tonic-gateLIBDEPS=	$(LIBPROM_DIR)/libprom.a $(LIBPLAT_DEP) \
1477c478bd9Sstevel@tonic-gate		$(LIBNAME_DIR)/libnames.a
1487c478bd9Sstevel@tonic-gate
1497c478bd9Sstevel@tonic-gateL_LIBDEPS=	$(LIBPROM_DIR)/llib-lprom.ln $(LIBPLAT_DEP_L) \
1507c478bd9Sstevel@tonic-gate		$(LIBNAME_DIR)/llib-lnames.ln
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gateinclude $(BOOTSRCDIR)/Makefile.rules
1537c478bd9Sstevel@tonic-gateinclude $(BOOTSRCDIR)/Makefile.targ
154