xref: /titanic_44/usr/src/psm/stand/bootlst/common/Makefile.com (revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4)
1e7cbe64fSgw25295#
2e7cbe64fSgw25295# CDDL HEADER START
3e7cbe64fSgw25295#
4e7cbe64fSgw25295# The contents of this file are subject to the terms of the
5e7cbe64fSgw25295# Common Development and Distribution License (the "License").
6e7cbe64fSgw25295# You may not use this file except in compliance with the License.
7e7cbe64fSgw25295#
8e7cbe64fSgw25295# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e7cbe64fSgw25295# or http://www.opensolaris.org/os/licensing.
10e7cbe64fSgw25295# See the License for the specific language governing permissions
11e7cbe64fSgw25295# and limitations under the License.
12e7cbe64fSgw25295#
13e7cbe64fSgw25295# When distributing Covered Code, include this CDDL HEADER in each
14e7cbe64fSgw25295# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15e7cbe64fSgw25295# If applicable, add the following below this CDDL HEADER, with the
16e7cbe64fSgw25295# fields enclosed by brackets "[]" replaced with your own identifying
17e7cbe64fSgw25295# information: Portions Copyright [yyyy] [name of copyright owner]
18e7cbe64fSgw25295#
19e7cbe64fSgw25295# CDDL HEADER END
20e7cbe64fSgw25295#
21*24fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22e7cbe64fSgw25295# Use is subject to license terms.
23e7cbe64fSgw25295#
24e7cbe64fSgw25295# psm/stand/bootlst/common/Makefile.com
25e7cbe64fSgw25295#
26e7cbe64fSgw25295
27e7cbe64fSgw25295TOPDIR	=	../../../../..
28e7cbe64fSgw25295
29e7cbe64fSgw25295include $(TOPDIR)/Makefile.master
30e7cbe64fSgw25295include $(TOPDIR)/Makefile.psm
31e7cbe64fSgw25295include $(TOPDIR)/psm/stand/lib/Makefile.lib
32e7cbe64fSgw25295
33e7cbe64fSgw25295SYSDIR	=  	$(TOPDIR)/uts
34e7cbe64fSgw25295COMDIR	=  	../../common
35e7cbe64fSgw25295STANDDIR = 	$(TOPDIR)/stand
36e7cbe64fSgw25295
37e7cbe64fSgw25295SALIBDIR =	$(STANDDIR)/lib/sa
38e7cbe64fSgw25295SALIB =		$(SALIBDIR)/libsa.a
39e7cbe64fSgw25295PROMLIBDIR=	$(PROMIFDIR)/$(ARCH_PROMDIR)
40e7cbe64fSgw25295PROMLIB	=	$(PROMLIBDIR)/libprom.a
41e7cbe64fSgw25295
42e7cbe64fSgw25295SALIBS +=	$(SALIB) $(PROMLIB)
43e7cbe64fSgw25295LDLIBS =	-L$(SALIBDIR) -lsa -L$(PROMLIBDIR) -lprom $(LDPLATLIBS)
44e7cbe64fSgw25295LDFLAGS =	-dn -M $(MAPFILE) $(MAP_FLAG)
45e7cbe64fSgw25295
46e7cbe64fSgw25295LINTLIBS =	$(SALIBDIR)/llib-lsa.ln $(PROMLIBDIR)/llib-lprom.ln $(LINTPLATLIBS)
47e7cbe64fSgw25295LINTFLAGS.lib =	-ysxmun
48e7cbe64fSgw25295
49e7cbe64fSgw25295BOOTLSTOBJ +=	 bootlst.o sasubr.o
50e7cbe64fSgw25295BOOTLSTLINTS =	$(BOOTLSTOBJ:%.o=%.ln)
51e7cbe64fSgw25295
52e7cbe64fSgw25295CPPDEFS =	-D$(ARCH) -D__$(ARCH) -D$(TARG_MACH) -D__$(TARG_MACH)
53e7cbe64fSgw25295CPPDEFS +=	-D_KERNEL -D_MACHDEP -D__ELF
54e7cbe64fSgw25295
55e7cbe64fSgw25295CPPINCS	=	-I$(SYSDIR)/common -I$(SYSDIR)/sun
56e7cbe64fSgw25295CPPINCS +=	-I$(SYSDIR)/$(MACH) -I$(PLATDIR)
57e7cbe64fSgw25295CPPINCS +=	-I$(STANDDIR)/lib/sa
58e7cbe64fSgw25295
59e7cbe64fSgw25295CPPFLAGS =	$(CPPDEFS) $(CPPINCS)
60e7cbe64fSgw25295CPPFLAGS	+= $(CCYFLAG)$(STANDDIR)
61e7cbe64fSgw25295
62e7cbe64fSgw25295C99MODE =	$(C99_ENABLE)
63e7cbe64fSgw25295CFLAGS =	$(CCVERBOSE) -O $(C99MODE)
64e7cbe64fSgw25295
65e7cbe64fSgw25295ASFLAGS = 	-P -D_ASM $(CPPDEFS) -DLOCORE -D_LOCORE -D__STDC__
66e7cbe64fSgw25295AS_CPPFLAGS =	$(CPPINCS) $(CPPFLAGS.master)
67e7cbe64fSgw25295
68e7cbe64fSgw25295# install values
69e7cbe64fSgw25295LSTFILES=	$(ALL:%=$(ROOT_PSM_DIR)/$(ARCH)/%)
70e7cbe64fSgw25295FILEMODE=	644
71e7cbe64fSgw25295
72e7cbe64fSgw25295# lint stuff
73e7cbe64fSgw25295LINTFLAGS += -Dlint
74e7cbe64fSgw25295LOPTS = -hbxn
75e7cbe64fSgw25295
76e7cbe64fSgw25295# install rule
77e7cbe64fSgw25295$(ROOT_PSM_DIR)/$(ARCH)/%: %
78e7cbe64fSgw25295	$(INS.file)
79e7cbe64fSgw25295
80e7cbe64fSgw25295
81e7cbe64fSgw25295all:	$(ALL)
82e7cbe64fSgw25295
83e7cbe64fSgw25295install: all $(LSTFILES)
84e7cbe64fSgw25295
85e7cbe64fSgw25295
86e7cbe64fSgw25295LINT.c=	$(LINT) $(LINTFLAGS.c) $(LINT_DEFS) $(CPPFLAGS) -c
87e7cbe64fSgw25295LINT.s=	$(LINT) $(LINTFLAGS.s) $(LINT_DEFS) $(CPPFLAGS) -c
88e7cbe64fSgw25295LINT.2= $(LINT) $(LINTFLAGS.c) $(LINT_DEFS) $(CPPFLAGS)
89e7cbe64fSgw25295
90e7cbe64fSgw25295# build rules
91e7cbe64fSgw25295
92e7cbe64fSgw25295%.o: $(COMDIR)/%.c
93e7cbe64fSgw25295	$(COMPILE.c) -o $@ $<
94e7cbe64fSgw25295
95e7cbe64fSgw25295%.ln: $(COMDIR)/%.c
96e7cbe64fSgw25295	@$(LHEAD) $(LINT.c) $< $(LTAIL)
97e7cbe64fSgw25295
98e7cbe64fSgw25295.KEEP_STATE:
99e7cbe64fSgw25295
100e7cbe64fSgw25295.PARALLEL:	$(BOOTLSTOBJ) $(BOOTLSTLINTS)
101e7cbe64fSgw25295
102e7cbe64fSgw25295bootlst: $(MAPFILE) $(BOOTLSTOBJ) $(SALIBS)
103e7cbe64fSgw25295	$(LD) $(LDFLAGS) -o $@ $(BOOTLSTOBJ) $(LDLIBS)
104e7cbe64fSgw25295	$(POST_PROCESS)
105e7cbe64fSgw25295
106e7cbe64fSgw25295$(SALIBS): FRC
107e7cbe64fSgw25295	@cd $(@D); $(MAKE) $(MFLAGS)
108e7cbe64fSgw25295
109e7cbe64fSgw25295$(LINTLIBS): FRC
110e7cbe64fSgw25295	@cd $(@D); $(MAKE) $(MFLAGS) $(@F)
111e7cbe64fSgw25295
112e7cbe64fSgw25295$(ROOTDIR):
113e7cbe64fSgw25295	$(INS.dir)
114e7cbe64fSgw25295
115e7cbe64fSgw25295lint: $(BOOTLSTLINTS) $(LINTLIBS)
116e7cbe64fSgw25295	@$(ECHO) "\n$@: global crosschecks:"
117e7cbe64fSgw25295	$(LINT.2) $(BOOTLSTLINTS) $(LINTLIBS)
118e7cbe64fSgw25295
119e7cbe64fSgw25295clean.lint:
120e7cbe64fSgw25295	$(RM) *.ln
121e7cbe64fSgw25295
122e7cbe64fSgw25295clean:
123e7cbe64fSgw25295	$(RM) *.o *.ln
124e7cbe64fSgw25295
125e7cbe64fSgw25295clobber:
126e7cbe64fSgw25295	$(RM) *.o *.ln $(ALL)
127e7cbe64fSgw25295
128e7cbe64fSgw25295FRC:
129