xref: /titanic_52/usr/src/psm/stand/boot/sparcv9/Makefile.com (revision d24234c24aeaca4ca56ee3ac2794507968f274c4)
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#
21*d24234c2SJerry 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
36*d24234c2SJerry GilliamPLAT_DIR	= sun4
3753391bafSeotaBOOT_DIR        = $(SRC)/psm/stand/boot
387c478bd9Sstevel@tonic-gate
39*d24234c2SJerry GilliamWANBOOT		= wanboot
40*d24234c2SJerry GilliamNFSBOOT		= inetboot
41*d24234c2SJerry Gilliam
42*d24234c2SJerry GilliamWANBOOT_SRC	= $(WANBOOT).c
43*d24234c2SJerry GilliamNFSBOOT_SRC	= $(NFSBOOT).c
447c478bd9Sstevel@tonic-gate
45986fd29aSsetjeCONF_SRC	= nfsconf.c wbfsconf.c wbcli.c
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateTOP_CMN_C_SRC	= getoptstr.c
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gateMISC_SRC	= ramdisk.c
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gateCMN_C_SRC	= heap_kmem.c readfile.c
527c478bd9Sstevel@tonic-gate
53986fd29aSsetjeMACH_C_SRC	= boot_plat.c bootops.c bootprop.c bootflags.c
54*d24234c2SJerry GilliamMACH_C_SRC	+= machdep.c sun4u_machdep.c sun4v_machdep.c
557c478bd9Sstevel@tonic-gateMACH_C_SRC	+= get.c
567c478bd9Sstevel@tonic-gate
57*d24234c2SJerry GilliamWANBOOT_OBJS	= $(WANBOOT_SRC:%.c=%.o)
58*d24234c2SJerry GilliamWANBOOT_L_OBJS	= $(WANBOOT_OBJS:%.o=%.ln)
59*d24234c2SJerry Gilliam
60*d24234c2SJerry GilliamNFSBOOT_OBJS	= $(NFSBOOT_SRC:%.c=%.o)
61*d24234c2SJerry GilliamNFSBOOT_L_OBJS	= $(NFSBOOT_OBJS:%.o=%.ln)
627c478bd9Sstevel@tonic-gate
637c478bd9Sstevel@tonic-gateCONF_OBJS	= $(CONF_SRC:%.c=%.o)
647c478bd9Sstevel@tonic-gateCONF_L_OBJS	= $(CONF_OBJS:%.o=%.ln)
657c478bd9Sstevel@tonic-gate
667c478bd9Sstevel@tonic-gateMISC_OBJS	= $(MISC_SRC:%.c=%.o)
677c478bd9Sstevel@tonic-gateMISC_L_OBJS	= $(MISC_OBJS:%.o=%.ln)
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gateSRT0_OBJ	= $(SRT0_S:%.s=%.o)
707c478bd9Sstevel@tonic-gateSRT0_L_OBJ	= $(SRT0_OBJ:%.o=%.ln)
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gateC_SRC		= $(TOP_CMN_C_SRC) $(CMN_C_SRC) $(MACH_C_SRC) $(ARCH_C_SRC)
737c478bd9Sstevel@tonic-gateC_SRC		+= $(PLAT_C_SRC)
747c478bd9Sstevel@tonic-gateS_SRC		= $(MACH_S_SRC) $(ARCH_S_SRC) $(PLAT_S_SRC)
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gateOBJS		= $(C_SRC:%.c=%.o) $(S_SRC:%.s=%.o)
777c478bd9Sstevel@tonic-gateL_OBJS		= $(OBJS:%.o=%.ln)
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gateCPPDEFS		= $(ARCHOPTS) -D$(PLATFORM) -D_BOOT -D_KERNEL -D_MACHDEP
807c478bd9Sstevel@tonic-gateCPPDEFS		+= -D_ELF64_SUPPORT
817c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(TOP_CMN_DIR)
827c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/common
837c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sun
847c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sun4
857c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/$(PLATFORM)
867c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sparc/$(ARCHVERS)
877c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/sparc
887c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/uts/$(ARCHMMU)
897c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/common/net/wanboot
907c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/common/net/wanboot/crypt
917c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(ROOT)/usr/platform/$(PLATFORM)/include
927c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(ROOT)/usr/include/$(ARCHVERS)
937c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(PSMSYSHDRDIR)
947c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(STANDDIR)
957c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(STANDDIR)/lib
967c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(STANDDIR)/lib/sa
977c478bd9Sstevel@tonic-gateCPPINCS		+= -I$(SRC)/common/net/dhcp
9853391bafSeotaCPPINCS		+= -I$(BOOT_DIR)/sparc/common
997c478bd9Sstevel@tonic-gateCPPFLAGS	= $(CPPDEFS) $(CPPINCS)
1007c478bd9Sstevel@tonic-gateCPPFLAGS	+= $(CCYFLAG)$(STANDDIR)
1017c478bd9Sstevel@tonic-gateASFLAGS		+= $(CPPDEFS) -P -D_ASM $(CPPINCS)
1027c478bd9Sstevel@tonic-gateCFLAGS64	+= ../../sparc/common/sparc.il
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate#
105*d24234c2SJerry Gilliam# Where to look for libraries.
1067c478bd9Sstevel@tonic-gate#
1077c478bd9Sstevel@tonic-gatePSMNAMELIBDIR	= $(PSMSTANDDIR)/lib/names/$(TARG_MACH)
1087c478bd9Sstevel@tonic-gatePSMPROMLIBDIR	= $(PSMSTANDDIR)/lib/promif/$(TARG_MACH)
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gate#
111*d24234c2SJerry Gilliam# Install targets
112*d24234c2SJerry Gilliam#
113*d24234c2SJerry GilliamROOT_PLAT_SUN4U_WANBOOT= $(ROOT_PLAT_DIR)/sun4u/$(WANBOOT)
114*d24234c2SJerry GilliamROOT_PLAT_SUN4V_WANBOOT= $(ROOT_PLAT_DIR)/sun4v/$(WANBOOT)
115*d24234c2SJerry Gilliam
116*d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB=$(USR_PLAT_DIR)/sun4u/lib
117*d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB_FS=$(USR_PLAT_SUN4U_LIB)/fs
118*d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB_FS_NFS=$(USR_PLAT_SUN4U_LIB_FS)/nfs
119*d24234c2SJerry GilliamUSR_PLAT_SUN4U_LIB_FS_NFS_NFSBOOT=$(USR_PLAT_SUN4U_LIB_FS_NFS)/$(NFSBOOT)
120*d24234c2SJerry Gilliam
121*d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB=$(USR_PLAT_DIR)/sun4v/lib
122*d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB_FS=$(USR_PLAT_SUN4V_LIB)/fs
123*d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB_FS_NFS=$(USR_PLAT_SUN4V_LIB_FS)/nfs
124*d24234c2SJerry GilliamUSR_PLAT_SUN4V_LIB_FS_NFS_NFSBOOT=$(USR_PLAT_SUN4V_LIB_FS_NFS)/$(NFSBOOT)
125*d24234c2SJerry Gilliam
126*d24234c2SJerry Gilliam#
1277c478bd9Sstevel@tonic-gate# The following libraries are built in LIBNAME_DIR
1287c478bd9Sstevel@tonic-gate#
1297c478bd9Sstevel@tonic-gateLIBNAME_DIR     += $(PSMNAMELIBDIR)/$(PLATFORM)
1307c478bd9Sstevel@tonic-gateLIBNAME_LIBS    += libnames.a
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate#
1337c478bd9Sstevel@tonic-gate# The following libraries are built in LIBPROM_DIR
1347c478bd9Sstevel@tonic-gate#
1357c478bd9Sstevel@tonic-gateLIBPROM_DIR     += $(PSMPROMLIBDIR)/$(PROMVERS)/common
1367c478bd9Sstevel@tonic-gateLIBPROM_LIBS    += libprom.a
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gate#
1397c478bd9Sstevel@tonic-gate# The following libraries are built in LIBSYS_DIR
1407c478bd9Sstevel@tonic-gate#
1417c478bd9Sstevel@tonic-gateLIBSYS_DIR      += $(SYSLIBDIR)
1427c478bd9Sstevel@tonic-gate
143*d24234c2SJerry Gilliam#.KEEP_STATE:
1447c478bd9Sstevel@tonic-gate#
1457c478bd9Sstevel@tonic-gate
146*d24234c2SJerry Gilliam.PARALLEL:	$(OBJS) $(CONF_OBJS) $(MISC_OBJS) $(SRT0_OBJ) \
147*d24234c2SJerry Gilliam		$(WANBOOT_OBJS) $(NFSBOOT_OBJS)
1487c478bd9Sstevel@tonic-gate.PARALLEL:	$(L_OBJS) $(CONF_L_OBJS) $(MISC_L_OBJS) $(SRT0_L_OBJ) \
149*d24234c2SJerry Gilliam		$(WANBOOT_L_OBJS) $(NFSBOOT_L_OBJS)
150986fd29aSsetje.PARALLEL:	$(NFSBOOT) $(WANBOOT)
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gate#
1537c478bd9Sstevel@tonic-gate# Note that the presumption is that someone has already done a `make
1547c478bd9Sstevel@tonic-gate# install' from usr/src/stand/lib, such that all of the standalone
1557c478bd9Sstevel@tonic-gate# libraries have been built and placed in $ROOT/stand/lib.
1567c478bd9Sstevel@tonic-gate#
1577c478bd9Sstevel@tonic-gateLIBDEPS=	$(LIBPROM_DIR)/libprom.a $(LIBPLAT_DEP) \
1587c478bd9Sstevel@tonic-gate		$(LIBNAME_DIR)/libnames.a
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gateL_LIBDEPS=	$(LIBPROM_DIR)/llib-lprom.ln $(LIBPLAT_DEP_L) \
1617c478bd9Sstevel@tonic-gate		$(LIBNAME_DIR)/llib-lnames.ln
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gateinclude $(BOOTSRCDIR)/Makefile.rules
1647c478bd9Sstevel@tonic-gateinclude $(BOOTSRCDIR)/Makefile.targ
165