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