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