xref: /illumos-gate/usr/src/psm/stand/lib/boot/sparc/Makefile.com (revision eb6b10e69fa5ba733da194d3ad71a0e63338be29)
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#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#
26# psm/stand/lib/boot/sparc/Makefile.com
27#
28# SPARC architecture Makefile for Standalone Library
29# Platform-specific, but shared between platforms.
30# Firmware dependent.
31#
32
33include $(TOPDIR)/Makefile.master
34include $(TOPDIR)/lib/Makefile.lib
35include $(TOPDIR)/psm/stand/lib/Makefile.lib
36
37PSMSYSHDRDIR =	$(TOPDIR)/psm/stand
38
39LIBBOOT =	libboot.a
40LINTLIBBOOT =	llib-lboot.ln
41
42# ARCHCMNDIR - common code for several machines of a given isa
43# OBJSDIR - where the .o's go
44
45ARCHCMNDIR =	$(TOPDIR)/uts/sparc/os
46OBJSDIR =	objs
47
48CMNSRCS =	bootops.c
49BOOTSRCS =	$(PLATSRCS) $(CMNSRCS)
50BOOTOBJS =	$(BOOTSRCS:%.c=%.o)
51
52OBJS =		$(BOOTOBJS:%=$(OBJSDIR)/%)
53L_OBJS =	$(OBJS:%.o=%.ln)
54L_SRCS =	$(CMNSRCS:%=$(ARCHCMNDIR)/%) $(PLATSRCS)
55
56CPPINCS +=	-I$(SRC)/uts/common
57CPPINCS +=	-I$(SRC)/uts/sun
58CPPINCS +=	-I$(SRC)/uts/sparc
59CPPINCS +=	-I$(SRC)/uts/sparc/$(ARCHVERS)
60CPPINCS +=	-I$(SRC)/uts/$(PLATFORM)
61CPPINCS += 	-I$(ROOT)/usr/include/$(ARCHVERS)
62CPPINCS += 	-I$(ROOT)/usr/platform/$(PLATFORM)/include
63CPPINCS += 	-I$(PSMSYSHDRDIR)
64CPPFLAGS =	$(CPPINCS) $(CCYFLAG)$(PSMSYSHDRDIR)
65CPPFLAGS +=	-D_KERNEL -D_BOOT -D_MACHDEP
66ASFLAGS =	-P -D__STDC__ -D_ASM $(CPPINCS)
67CFLAGS +=	$(CCVERBOSE)
68
69.KEEP_STATE:
70
71.PARALLEL:	$(OBJS) $(L_OBJS)
72
73all install: $(LIBBOOT) .WAIT
74
75lint: $(LINTLIBBOOT)
76
77clean:
78	$(RM) $(OBJS) $(L_OBJS)
79
80clobber: clean
81	$(RM) $(LIBBOOT) $(LINTLIBBOOT)
82
83$(LIBBOOT): $(OBJSDIR) .WAIT $(OBJS)
84	$(BUILD.AR) $(OBJS)
85
86$(LINTLIBBOOT): $(OBJSDIR) .WAIT $(L_OBJS)
87	@$(ECHO) "\nlint library construction:" $@
88	@$(LINT.lib) -o boot $(L_SRCS)
89
90$(OBJSDIR):
91	-@[ -d $@ ] || mkdir $@
92
93#
94# build rules using standard library object subdirectory
95#
96$(OBJSDIR)/%.o: $(ARCHCMNDIR)/%.c
97	$(COMPILE.c) -o $@ $<
98	$(POST_PROCESS_O)
99
100$(OBJSDIR)/%.o: $(ARCHCMNDIR)/%.s
101	$(COMPILE.s) -o $@ $<
102	$(POST_PROCESS_O)
103
104$(OBJSDIR)/%.ln: $(ARCHCMNDIR)/%.c
105	@($(LHEAD) $(LINT.c) $< $(LTAIL))
106	@$(MV) $(@F) $@
107
108$(OBJSDIR)/%.ln: $(ARCHCMNDIR)/%.s
109	@($(LHEAD) $(LINT.s) $< $(LTAIL))
110	@$(MV) $(@F) $@
111