1*dc0093f4Seschrock#
2*dc0093f4Seschrock# CDDL HEADER START
3*dc0093f4Seschrock#
4*dc0093f4Seschrock# The contents of this file are subject to the terms of the
5*dc0093f4Seschrock# Common Development and Distribution License (the "License").
6*dc0093f4Seschrock# You may not use this file except in compliance with the License.
7*dc0093f4Seschrock#
8*dc0093f4Seschrock# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*dc0093f4Seschrock# or http://www.opensolaris.org/os/licensing.
10*dc0093f4Seschrock# See the License for the specific language governing permissions
11*dc0093f4Seschrock# and limitations under the License.
12*dc0093f4Seschrock#
13*dc0093f4Seschrock# When distributing Covered Code, include this CDDL HEADER in each
14*dc0093f4Seschrock# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*dc0093f4Seschrock# If applicable, add the following below this CDDL HEADER, with the
16*dc0093f4Seschrock# fields enclosed by brackets "[]" replaced with your own identifying
17*dc0093f4Seschrock# information: Portions Copyright [yyyy] [name of copyright owner]
18*dc0093f4Seschrock#
19*dc0093f4Seschrock# CDDL HEADER END
20*dc0093f4Seschrock#
21*dc0093f4Seschrock#
22*dc0093f4Seschrock# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*dc0093f4Seschrock# Use is subject to license terms.
24*dc0093f4Seschrock#
25*dc0093f4Seschrock# ident	"%Z%%M%	%I%	%E% SMI"
26*dc0093f4Seschrock#
27*dc0093f4Seschrock# We build each flavor in a separate make invocation to improve clarity(!) in
28*dc0093f4Seschrock# Makefile.com.  The subordinate makes have $(CURTYPE) set to indicate the
29*dc0093f4Seschrock# flavor they're supposed to build.  This causes the correct set of source
30*dc0093f4Seschrock# files and compiler and linker flags to be selected.
31*dc0093f4Seschrock#
32*dc0093f4Seschrock# The SPARC library is built from the closed gate.  This Makefile is shared
33*dc0093f4Seschrock# between both environments, so all paths must be absolute.
34*dc0093f4Seschrock#
35*dc0093f4Seschrock
36*dc0093f4Seschrockinstall: $(TYPES:%=install.%)
37*dc0093f4Seschrock
38*dc0093f4Seschrockall: $(TYPES:%=all.%)
39*dc0093f4Seschrock
40*dc0093f4Seschrock$(TYPES:%=all.%):
41*dc0093f4Seschrock	@CURTYPE=$(@:all.%=%) $(MAKE) $@.targ
42*dc0093f4Seschrock
43*dc0093f4Seschrock$(TYPES:%=install.%):
44*dc0093f4Seschrock	@CURTYPE=$(@:install.%=%) $(MAKE) $@.targ
45*dc0093f4Seschrock
46*dc0093f4Seschrockinstall.library.targ: all.library $(INSTALL_DEPS_library)
47*dc0093f4Seschrockinstall.standalone.targ: all.standalone $(INSTALL_DEPS_standalone)
48*dc0093f4Seschrock
49*dc0093f4Seschrockall.library.targ: $(LIBS)
50*dc0093f4Seschrockall.standalone.targ: $(STANDLIBRARY)
51*dc0093f4Seschrock
52*dc0093f4Seschrocklint: $(TYPES:%=lint.%)
53*dc0093f4Seschrock
54*dc0093f4Seschrock$(TYPES:%=lint.%):
55*dc0093f4Seschrock	@CURTYPE=$(@:lint.%=%) $(MAKE) lintcheck
56*dc0093f4Seschrock
57*dc0093f4Seschrock$(STANDLIBRARY): $(OBJS) $(LINKTEST_OBJ)
58*dc0093f4Seschrock	$(LD) -Breduce -zdefs $(LDFLAGS) -o $@.linktest $(OBJS) $(LINKTEST_OBJ)
59*dc0093f4Seschrock	rm $@.linktest
60*dc0093f4Seschrock	$(LD) $(LDFLAGS) -o $@ $(OBJS)
61*dc0093f4Seschrock
62*dc0093f4Seschrock$(DYNLIB):	$(MAPFILE)
63*dc0093f4Seschrock
64*dc0093f4Seschrock$(MAPFILE):
65*dc0093f4Seschrock	@cd $(MAPDIR); $(MAKE) mapfile
66*dc0093f4Seschrock
67*dc0093f4Seschrockclobber: $(TYPES:%=clobber.%)
68*dc0093f4Seschrock
69*dc0093f4Seschrock$(TYPES:%=clobber.%):
70*dc0093f4Seschrock	@CURTYPE=$(@:clobber.%=%) $(MAKE) clobber.targ
71*dc0093f4Seschrock
72*dc0093f4Seschrockclobber.targ: clean
73*dc0093f4Seschrock	-$(RM) $(CLOBBERTARGFILES)
74*dc0093f4Seschrock
75*dc0093f4Seschrock# include library targets
76*dc0093f4Seschrockinclude $(SRC)/lib/Makefile.targ
77*dc0093f4Seschrock
78*dc0093f4Seschrock$(PICS): pics
79*dc0093f4Seschrock$(OBJS): objs
80*dc0093f4Seschrock
81*dc0093f4Seschrockobjs/%.o pics/%.o: $(ISASRCDIR)/%.c
82*dc0093f4Seschrock	$(COMPILE.c) -o $@ $<
83*dc0093f4Seschrock	$(POST_PROCESS_O)
84*dc0093f4Seschrock
85*dc0093f4Seschrockobjs/%.o pics/%.o: $(ISASRCDIR)/%.s
86*dc0093f4Seschrock	$(COMPILE.s) -o $@ $<
87*dc0093f4Seschrock	$(POST_PROCESS_O)
88*dc0093f4Seschrock
89*dc0093f4Seschrockobjs/%.o pics/%.o: $(COMDIR)/%.c
90*dc0093f4Seschrock	$(COMPILE.c) -o $@ $<
91*dc0093f4Seschrock	$(POST_PROCESS_O)
92*dc0093f4Seschrock
93*dc0093f4Seschrock# install rule for lint library target
94*dc0093f4Seschrock$(ROOTLINTDIR)/%: $(COMDIR)/%
95*dc0093f4Seschrock	$(INS.file)
96*dc0093f4Seschrock
97*dc0093f4Seschrock# install rule for x86 common source
98*dc0093f4Seschrockobjs/%.o pics/%.o: $(SRC)/common/dis/i386/%.c
99*dc0093f4Seschrock	$(COMPILE.c) -o $@ $<
100*dc0093f4Seschrock	$(POST_PROCESS_O)
101