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