4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # Copyright 2014 Gary Mills
23 # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 TOPDIR
= ..
/..
/..
/..
/..
29 include $(TOPDIR
)/uts
/Makefile.uts
32 install := TARGET
= install
33 clean := TARGET
= clean
36 TARG_MACH_DIR
= sparcv9
41 ASFLAGS
+= $(sparcv9_XARCH
)
43 ARCH_C_SRC
= sun4u_memlist.c sun4x_standalloc.c sun4dep.c
44 ARCH_S_SRC
= sparcv9_subr.s
48 LDFLAGS
+= -L
$(TOPDIR
)/psm
/stand
/lib
/promif
/$(TARG_MACH
)/$(PROMVERS
)/common
51 # The following libraries are build in LIBPLAT_DIR
53 LIBPLAT_DIR
= $(TOPDIR
)/psm
/stand
/lib
/promif
/$(TARG_MACH
)/$(PROMVERS
)/$(PLATFORM
)
54 LIBPLAT_LIBS
= libplat.a
55 LIBPLAT_L_LIBS
= $(LIBPLAT_LIBS
:lib
%.a
=llib-l
%.ln
)
56 LIBPLAT_DEP
= $(LIBPLAT_DIR
)/$(LIBPLAT_LIBS
)
57 LIBPLAT_DEP_L
= $(LIBPLAT_DIR
)/$(LIBPLAT_L_LIBS
)
60 # Platform specific libraries
62 PSMLIBS
+= $(LIBPLAT_LIBS
:lib
%.a
=-l
%)
63 PSMLIB_DIRS
+= $(LIBPLAT_DIR
)
65 include ..
/Makefile.com
67 CPPINCS
+= -I
$(TOPDIR
)/psm
/stand
/boot
/sparc
/sun4
70 # Set the choice of compiler.
72 include $(TOPDIR
)/psm
/Makefile.psm
.64
74 CFLAGS64
+= -xchip
=ultra
$(CCABS32
)
77 # XXX this totally sucks since it effectively turns off -errchk=longptr64,
78 # which we really should be using.
80 LINTFLAGS64
= $(LINTFLAGS
) -m64
83 # Cross-reference customization: include all boot-related source files.
85 STANDLIBDIR
= ..
/..
/..
/..
/..
/stand
/lib
86 STANDSYSDIR
= ..
/..
/..
/..
/..
/stand
/sys
87 PROMDIRS
= ..
/..
/..
/..
/promif
88 NAMESDIRS
= ..
/..
/..
/lib
/names
/sparcv9 ..
/..
/..
/lib
/names
/sparc
/common
89 XRDIRS
+= ..
/..
/sparc
/common ..
/..
/common
$(STANDLIBDIR
) \
90 $(STANDSYSDIR
) $(PROMDIRS
) $(NAMESDIRS
)
94 #############################
98 # Libraries used to build nfsboot
100 LIBNFS_LIBS
= libnfs.a libxdr.a libnames.a \
101 libsock.a libinet.a libtcp.a libsa.a libprom.a \
103 NFS_LIBS
= $(LIBNFS_LIBS
:lib
%.a
=-l
%)
104 NFS_DIRS
= $(LIBNAME_DIR
:%=-L
%) $(LIBSYS_DIR
:%=-L
%)
105 NFS_DIRS
+= $(LIBPLAT_DIR
:%=-L
%) $(LIBPROM_DIR
:%=-L
%)
108 # Loader flags used to build inetboot
110 NFS_MAPFILE
= $(MACH_DIR
)/mapfile
111 NFS_LDFLAGS
= -dn
-M
$(NFS_MAPFILE
) -e _start
$(NFS_DIRS
)
112 NFS_L_LDFLAGS
= $(NFS_DIRS
)
115 # Object files used to build inetboot
117 NFS_SRT0
= $(SRT0_OBJ
)
118 NFS_OBJS
= $(OBJS
) nfsconf.o inetboot.o ramdisk.o
119 NFS_L_OBJS
= $(NFS_SRT0
:%.o
=%.ln
) $(NFS_OBJS
:%.o
=%.ln
)
122 #include $(BOOTSRCDIR)/Makefile.rules
131 $(USR_PLAT_SUN4U_LIB_FS_NFS_NFSBOOT
) \
132 $(USR_PLAT_SUN4V_LIB_FS_NFS_NFSBOOT
)
134 $(NFSBOOT
): $(NFS_MAPFILE
) $(NFS_SRT0
) $(NFS_OBJS
) $(LIBDEPS
)
135 $(LD
) $(NFS_LDFLAGS
) -o
$@
$(NFS_SRT0
) $(NFS_OBJS
) $(NFS_LIBS
)
141 $(NFSBOOT
)_lint
: $(NFS_L_OBJS
) $(L_LIBDEPS
)
143 @echo inetboot lint
: global crosschecks
:
144 $(LINT.c
) $(NFS_L_LDFLAGS
) $(NFS_L_OBJS
) $(NFS_LIBS
)
146 $(USR_PLAT_SUN4U_LIB_FS_NFS
):
149 $(USR_PLAT_SUN4V_LIB_FS_NFS
):
152 $(USR_PLAT_SUN4U_LIB_FS_NFS_NFSBOOT
): $(USR_PLAT_SUN4U_LIB_FS_NFS
) $(NFSBOOT
)
153 $(INS
) -s
-m
$(FILEMODE
) -f
$(USR_PLAT_SUN4U_LIB_FS_NFS
) $(NFSBOOT
)
155 $(USR_PLAT_SUN4V_LIB_FS_NFS_NFSBOOT
): $(USR_PLAT_SUN4V_LIB_FS_NFS
) $(NFSBOOT
)
156 $(INS
) -s
-m
$(FILEMODE
) -f
$(USR_PLAT_SUN4V_LIB_FS_NFS
) $(NFSBOOT
)
158 $(STRIPALIGN
): $(CMN_DIR
)/$$(@
).c
159 $(NATIVECC
) -o
$@
$(CMN_DIR
)/$@.c
162 $(RM
) make.out lint.out
163 $(RM
) $(OBJS
) $(CONF_OBJS
) $(MISC_OBJS
) $(SRT0_OBJ
)
164 $(RM
) $(NFSBOOT_OBJS
)
165 $(RM
) $(L_OBJS
) $(CONF_L_OBJS
) $(MISC_L_OBJS
) $(SRT0_L_OBJ
)
166 $(RM
) $(NFSBOOT_L_OBJS
)
169 $(RM
) $(NFSBOOT
) $(STRIPALIGN
)
171 lint
: $(NFSBOOT
)_lint