xref: /illumos-gate/usr/src/psm/stand/bootlst/common/Makefile.com (revision a92282e44f968185a6bba094d1e5fece2da819cf)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24# psm/stand/bootlst/common/Makefile.com
25#
26
27TOPDIR	=	../../../../..
28
29include $(TOPDIR)/Makefile.master
30include $(TOPDIR)/Makefile.psm
31include $(TOPDIR)/psm/stand/lib/Makefile.lib
32
33SYSDIR	=	$(TOPDIR)/uts
34COMDIR	=	../../common
35STANDDIR =	$(TOPDIR)/stand
36
37SALIBDIR =	$(STANDDIR)/lib/sa
38SALIB =		$(SALIBDIR)/libsa.a
39PROMLIBDIR=	$(PROMIFDIR)/$(ARCH_PROMDIR)
40PROMLIB	=	$(PROMLIBDIR)/libprom.a
41
42SALIBS +=	$(SALIB) $(PROMLIB)
43LDLIBS =	-L$(SALIBDIR) -lsa -L$(PROMLIBDIR) -lprom $(LDPLATLIBS)
44LDFLAGS =	-Wl,-dn -Wl,-M$(MAPFILE) $(MAP_FLAG)
45
46BOOTLSTOBJ +=	 bootlst.o sasubr.o
47
48CPPDEFS =	-D$(ARCH) -D__$(ARCH) -D$(TARG_MACH) -D__$(TARG_MACH)
49CPPDEFS +=	-D_KERNEL -D_MACHDEP -D__ELF
50
51CPPINCS	=	-I$(SYSDIR)/common -I$(SYSDIR)/sun
52CPPINCS +=	-I$(SYSDIR)/$(MACH) -I$(PLATDIR)
53CPPINCS +=	-I$(STANDDIR)/lib/sa
54
55CPPFLAGS =	$(CPPDEFS) $(CPPINCS)
56CPPFLAGS	+= $(CCYFLAG)$(STANDDIR)
57
58CSTD =	$(CSTD_GNU99)
59CFLAGS =	$(CCVERBOSE) -O $(CSTD)
60
61ASFLAGS =	-P -D_ASM $(CPPDEFS) -DLOCORE -D_LOCORE -D__STDC__
62AS_CPPFLAGS =	$(CPPINCS) $(CPPFLAGS.master)
63
64# install values
65LSTFILES=	$(ALL:%=$(ROOT_PSM_DIR)/$(ARCH)/%)
66FILEMODE=	644
67
68# install rule
69$(ROOT_PSM_DIR)/$(ARCH)/%: %
70	$(INS.file)
71
72
73all:	$(ALL)
74
75install: all $(LSTFILES)
76
77# build rules
78
79%.o: $(COMDIR)/%.c
80	$(COMPILE.c) -o $@ $<
81
82.KEEP_STATE:
83
84.PARALLEL:	$(BOOTLSTOBJ)
85
86bootlst: $(MAPFILE) $(BOOTLSTOBJ) $(SALIBS)
87	$(LD) $(LDFLAGS) -o $@ $(BOOTLSTOBJ) $(LDLIBS)
88	$(POST_PROCESS)
89
90$(SALIBS): FRC
91	@cd $(@D); $(MAKE) $(MFLAGS)
92
93$(ROOTDIR):
94	$(INS.dir)
95
96clean:
97	$(RM) *.o *.ln
98
99clobber:
100	$(RM) *.o *.ln $(ALL)
101
102FRC:
103