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