xref: /titanic_44/usr/src/psm/stand/lib/names/sparcv9/Makefile.com (revision 2b4a78020b9c38d1b95e2f3fefa6d6e4be382d1f)
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/names/sparcv9/Makefile.com
29#
30# SPARCv9 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
40STANDDIR =	$(TOPDIR)/stand
41
42LIBNAMES =	libnames.a
43LINTLIBNAMES =	llib-lnames.ln
44
45# ARCHCMNDIR - common code for several machines of a given isa
46# OBJSDIR - where the .o's go
47
48ARCHCMNDIR =	../../sparc/common
49OBJSDIR =	objs
50
51CMNSRCS =	uname-i.c uname-m.c mfgname.c
52NAMESRCS =	$(PLATSRCS) $(CMNSRCS)
53NAMEOBJS =	$(NAMESRCS:%.c=%.o)
54
55OBJS =		$(NAMEOBJS:%=$(OBJSDIR)/%)
56L_OBJS =	$(OBJS:%.o=%.ln)
57L_SRCS =	$(CMNSRCS:%=$(ARCHCMNDIR)/%) $(PLATSRCS)
58
59CPPINCS +=	-I$(SRC)/uts/common
60CPPINCS +=	-I$(SRC)/uts/sun
61CPPINCS +=	-I$(SRC)/uts/sparc
62CPPINCS +=	-I$(SRC)/uts/sparc/$(ARCHVERS)
63CPPINCS +=	-I$(SRC)/uts/sun4
64CPPINCS +=	-I$(SRC)/uts/$(PLATFORM)
65CPPINCS += 	-I$(ROOT)/usr/include/$(ARCHVERS)
66CPPINCS += 	-I$(ROOT)/usr/platform/$(PLATFORM)/include
67CPPINCS += 	-I$(PSMSYSHDRDIR)
68CPPINCS += 	-I$(STANDDIR)
69CPPINCS += 	-I$(STANDDIR)/lib/sa
70CPPFLAGS =	$(CPPINCS) $(CCYFLAG)$(PSMSYSHDRDIR)
71CPPFLAGS +=	-D_KERNEL
72ASFLAGS =	-P -D__STDC__ -D_ASM $(CPPINCS)
73CFLAGS +=	$(CCVERBOSE)
74
75.KEEP_STATE:
76
77.PARALLEL:	$(OBJS) $(L_OBJS)
78
79all install: $(LIBNAMES) .WAIT
80
81lint: $(LINTLIBNAMES)
82
83clean:
84	$(RM) $(OBJS) $(L_OBJS)
85
86clobber: clean
87	$(RM) $(LIBNAMES) $(LINTLIBNAMES) a.out core
88
89$(LIBNAMES): $(OBJSDIR) .WAIT $(OBJS)
90	$(BUILD.AR) $(OBJS)
91
92$(LINTLIBNAMES): $(OBJSDIR) .WAIT $(L_OBJS)
93	@$(ECHO) "\nlint library construction:" $@
94	@$(LINT.lib) -o names $(L_SRCS)
95
96$(OBJSDIR):
97	-@[ -d $@ ] || mkdir $@
98
99#
100# build rules using standard library object subdirectory
101#
102$(OBJSDIR)/%.o: $(ARCHCMNDIR)/%.c
103	$(COMPILE.c) -o $@ $<
104	$(POST_PROCESS_O)
105
106$(OBJSDIR)/%.o: $(ARCHCMNDIR)/%.s
107	$(COMPILE.s) -o $@ $<
108	$(POST_PROCESS_O)
109
110$(OBJSDIR)/%.ln: $(ARCHCMNDIR)/%.c
111	@($(LHEAD) $(LINT.c) $< $(LTAIL))
112	@$(MV) $(@F) $@
113
114$(OBJSDIR)/%.ln: $(ARCHCMNDIR)/%.s
115	@($(LHEAD) $(LINT.s) $< $(LTAIL))
116	@$(MV) $(@F) $@
117