xref: /titanic_41/usr/src/psm/stand/lib/boot/sparc/Makefile.com (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# psm/stand/lib/boot/sparc/Makefile.com
29#
30# SPARC architecture Makefile for Standalone Library
31# Platform-specific, but shared between platforms.
32# Firmware dependent.
33#
34
35include $(TOPDIR)/Makefile.master
36include $(TOPDIR)/lib/Makefile.lib
37include $(TOPDIR)/psm/stand/lib/Makefile.lib
38
39PSMSYSHDRDIR =	$(TOPDIR)/psm/stand
40
41LIBBOOT =	libboot.a
42LINTLIBBOOT =	llib-lboot.ln
43
44# ARCHCMNDIR - common code for several machines of a given isa
45# OBJSDIR - where the .o's go
46
47ARCHCMNDIR =	$(TOPDIR)/uts/sparc/os
48OBJSDIR =	objs
49
50CMNSRCS =	bootops.c
51BOOTSRCS =	$(PLATSRCS) $(CMNSRCS)
52BOOTOBJS =	$(BOOTSRCS:%.c=%.o)
53
54OBJS =		$(BOOTOBJS:%=$(OBJSDIR)/%)
55L_OBJS =	$(OBJS:%.o=%.ln)
56L_SRCS =	$(CMNSRCS:%=$(ARCHCMNDIR)/%) $(PLATSRCS)
57
58CPPINCS +=	-I$(SRC)/uts/common
59CPPINCS +=	-I$(SRC)/uts/sun
60CPPINCS +=	-I$(SRC)/uts/sparc
61CPPINCS +=	-I$(SRC)/uts/sparc/$(ARCHVERS)
62CPPINCS +=	-I$(SRC)/uts/$(PLATFORM)
63CPPINCS += 	-I$(ROOT)/usr/include/$(ARCHVERS)
64CPPINCS += 	-I$(ROOT)/usr/platform/$(PLATFORM)/include
65CPPINCS += 	-I$(PSMSYSHDRDIR)
66CPPFLAGS =	$(CPPINCS) $(CCYFLAG)$(PSMSYSHDRDIR)
67CPPFLAGS +=	-D_KERNEL -D_BOOT
68ASFLAGS =	-P -D__STDC__ -D_ASM $(CPPINCS)
69CFLAGS +=	$(CCVERBOSE)
70
71.KEEP_STATE:
72
73.PARALLEL:	$(OBJS) $(L_OBJS)
74
75all install: $(LIBBOOT) .WAIT
76
77lint: $(LINTLIBBOOT)
78
79clean:
80	$(RM) $(OBJS) $(L_OBJS)
81
82clobber: clean
83	$(RM) $(LIBBOOT) $(LINTLIBBOOT) a.out core
84
85$(LIBBOOT): $(OBJSDIR) .WAIT $(OBJS)
86	$(BUILD.AR) $(OBJS)
87
88$(LINTLIBBOOT): $(OBJSDIR) .WAIT $(L_OBJS)
89	@$(ECHO) "\nlint library construction:" $@
90	@$(LINT.lib) -o boot $(L_SRCS)
91
92$(OBJSDIR):
93	-@[ -d $@ ] || mkdir $@
94
95#
96# build rules using standard library object subdirectory
97#
98$(OBJSDIR)/%.o: $(ARCHCMNDIR)/%.c
99	$(COMPILE.c) -o $@ $<
100	$(POST_PROCESS_O)
101
102$(OBJSDIR)/%.o: $(ARCHCMNDIR)/%.s
103	$(COMPILE.s) -o $@ $<
104	$(POST_PROCESS_O)
105
106$(OBJSDIR)/%.ln: $(ARCHCMNDIR)/%.c
107	@($(LHEAD) $(LINT.c) $< $(LTAIL))
108	@$(MV) $(@F) $@
109
110$(OBJSDIR)/%.ln: $(ARCHCMNDIR)/%.s
111	@($(LHEAD) $(LINT.s) $< $(LTAIL))
112	@$(MV) $(@F) $@
113