1702941cdSRichard Lowe#
2702941cdSRichard Lowe# CDDL HEADER START
3702941cdSRichard Lowe#
4702941cdSRichard Lowe# The contents of this file are subject to the terms of the
5702941cdSRichard Lowe# Common Development and Distribution License (the "License").
6702941cdSRichard Lowe# You may not use this file except in compliance with the License.
7702941cdSRichard Lowe#
8702941cdSRichard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9702941cdSRichard Lowe# or http://www.opensolaris.org/os/licensing.
10702941cdSRichard Lowe# See the License for the specific language governing permissions
11702941cdSRichard Lowe# and limitations under the License.
12702941cdSRichard Lowe#
13702941cdSRichard Lowe# When distributing Covered Code, include this CDDL HEADER in each
14702941cdSRichard Lowe# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15702941cdSRichard Lowe# If applicable, add the following below this CDDL HEADER, with the
16702941cdSRichard Lowe# fields enclosed by brackets "[]" replaced with your own identifying
17702941cdSRichard Lowe# information: Portions Copyright [yyyy] [name of copyright owner]
18702941cdSRichard Lowe#
19702941cdSRichard Lowe# CDDL HEADER END
20702941cdSRichard Lowe#
21702941cdSRichard Lowe#
22702941cdSRichard Lowe# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23702941cdSRichard Lowe# Use is subject to license terms.
24*89d58ee0SChris Fraire# Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
25702941cdSRichard Lowe#
26702941cdSRichard Lowe
27702941cdSRichard Lowe#
28702941cdSRichard Lowe# We build each flavor in a separate make invocation to improve clarity(!) in
29702941cdSRichard Lowe# Makefile.com.  The subordinate makes have $(CURTYPE) set to indicate the
30702941cdSRichard Lowe# flavor they're supposed to build.  This causes the correct set of source
31702941cdSRichard Lowe# files and compiler and linker flags to be selected.
32702941cdSRichard Lowe#
33702941cdSRichard Lowe
34702941cdSRichard Loweinstall: $(TYPES:%=install.%)
35702941cdSRichard Lowe
36702941cdSRichard Loweall: $(TYPES:%=all.%)
37702941cdSRichard Lowe
38702941cdSRichard Lowe$(TYPES:%=all.%):
39*89d58ee0SChris Fraire	@$(MAKE) $@.targ CURTYPE=$(@:all.%=%)
40702941cdSRichard Lowe
41702941cdSRichard Lowe$(TYPES:%=install.%):
42*89d58ee0SChris Fraire	@$(MAKE) $@.targ CURTYPE=$(@:install.%=%)
43702941cdSRichard Lowe
44702941cdSRichard Loweinstall.library.targ: all.library $(INSTALL_DEPS_library)
45702941cdSRichard Loweinstall.standalone.targ: all.standalone $(INSTALL_DEPS_standalone)
46702941cdSRichard Lowe
47702941cdSRichard Loweall.library.targ: $(LIBS)
48702941cdSRichard Loweall.standalone.targ: $(STANDLIBRARY)
49702941cdSRichard Lowe
50702941cdSRichard Lowe$(STANDLIBRARY): $(OBJS) $(LINKTEST_OBJ)
51702941cdSRichard Lowe	$(LD) $(BREDUCE) $(ZDEFS) $(LDFLAGS) -o $@.linktest $(OBJS) $(LINKTEST_OBJ)
52702941cdSRichard Lowe	rm $@.linktest
53702941cdSRichard Lowe	$(LD) $(LDFLAGS) -o $@ $(OBJS)
54702941cdSRichard Lowe
55702941cdSRichard Loweclobber: $(TYPES:%=clobber.%)
56702941cdSRichard Lowe
57702941cdSRichard Lowe$(TYPES:%=clobber.%):
58*89d58ee0SChris Fraire	@$(MAKE) clobber.targ CURTYPE=$(@:clobber.%=%)
59702941cdSRichard Lowe
60702941cdSRichard Loweclobber.targ: clean
61702941cdSRichard Lowe	-$(RM) $(CLOBBERTARGFILES)
62702941cdSRichard Lowe
63702941cdSRichard Lowe# include library targets
64702941cdSRichard Loweinclude $(SRC)/lib/Makefile.targ
65702941cdSRichard Lowe
66702941cdSRichard Lowe$(PICS): pics
67702941cdSRichard Lowe$(OBJS): objs
68702941cdSRichard Lowe
69702941cdSRichard Loweobjs/%.o pics/%.o: $(COMDIR)/%.c
70702941cdSRichard Lowe	$(COMPILE.c) -o $@ $<
71702941cdSRichard Lowe	$(POST_PROCESS_O)