xref: /titanic_44/usr/src/lib/libumem/Makefile.targ (revision fb3fb4f3d76d55b64440afd0af72775dfad3bd1d)
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
29#
30# We build each flavor in a separate make invocation to improve clarity(!) in
31# Makefile.com.  The subordinate makes have $(CURTYPE) set to indicate the
32# flavor they're supposed to build.  This causes the correct set of source
33# files and compiler and linker flags to be selected.
34#
35
36install: $(TYPES:%=install.%)
37
38install.library: all.library $(INSTALL_DEPS_library)
39install.standalone: all.standalone $(INSTALL_DEPS_standalone)
40
41all: $(TYPES:%=all.%)
42
43$(TYPES:%=all.%):
44	@CURTYPE=$(@:all.%=%) $(MAKE) $@.targ
45
46all.library.targ: $(LIBS)
47all.standalone.targ: $(STANDLIBRARY)
48
49lint: $(TYPES:%=lint.%)
50
51$(TYPES:%=lint.%):
52	@CURTYPE=$(@:lint.%=%) $(MAKE) lintcheck
53
54$(STANDLIBRARY): $(OBJS) $(LINKTEST_OBJ)
55	$(LD) -Breduce -zdefs $(LDFLAGS) -o $@.linktest $(OBJS) $(LINKTEST_OBJ)
56	rm $@.linktest
57	$(LD) $(LDFLAGS) -o $@ $(OBJS)
58
59$(DYNLIB):	$(MAPFILE)
60
61$(MAPFILE):
62	@cd $(MAPDIR); $(MAKE) mapfile
63
64clobber: $(TYPES:%=clobber.%)
65
66$(TYPES:%=clobber.%):
67	@CURTYPE=$(@:clobber.%=%) $(MAKE) clobber.targ
68
69clobber.targ: clean
70	-$(RM) $(CLOBBERTARGFILES)
71
72# include library targets
73include ../../Makefile.targ
74
75$(PICS): pics
76$(OBJS): objs
77
78objs/%.o pics/%.o: $(ISASRCDIR)/%.c
79	$(COMPILE.c) -o $@ $<
80	$(POST_PROCESS_O)
81
82objs/%.o pics/%.o: $(ISASRCDIR)/%.s
83	$(COMPILE.s) -o $@ $<
84	$(POST_PROCESS_O)
85
86objs/%.o pics/%.o: ../common/%.c
87	$(COMPILE.c) -o $@ $<
88	$(POST_PROCESS_O)
89
90# install rule for lint library target
91$(ROOTLINTDIR)/%: ../common/%
92	$(INS.file)
93