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