xref: /titanic_41/usr/src/lib/Makefile.targ (revision 20ae46ebaff1237662e05edf9db61538aa85d448)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28#
29# included to define local library targets
30#
31
32# conditional assignment of default permissions for the installed
33# DYNLIB/DYNLIBCCC.  Set here and in Makefile.mach, instead of Makefile.lib,
34# because ROOTLIBDIR may be changed in the including makefile after it has
35# included Makefile.lib.
36#
37$(ROOTLIBDIR)/$(DYNLIB) :=	FILEMODE= 755
38$(ROOTLIBDIR)/$(DYNLIBCCC) :=	FILEMODE= 755
39
40$(ROOTFS_LIBDIR)/$(DYNLIB) :=	FILEMODE= 755
41$(ROOTFS_LIBDIR)/$(DYNLIBCCC) :=	FILEMODE= 755
42
43$(ROOTLIBDIR64)/$(DYNLIB) :=	FILEMODE= 755
44$(ROOTLIBDIR64)/$(DYNLIBCCC) :=	FILEMODE= 755
45
46# install rules
47$(ROOTHDRDIR)/%: $(HDRDIR)/%
48	$(INS.file)
49
50$(ROOTLIBDIR)/%: %
51	$(INS.file)
52$(ROOTLIBDIR64)/%: %
53	$(INS.file)
54$(ROOTFS_LIBDIR)/%: %
55	$(INS.file)
56$(ROOTFS_LIBDIR64)/%: %
57	$(INS.file)
58
59$(ROOTLIBDIR)/$(LIBLINKS): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
60	$(INS.liblink)
61$(ROOTLIBDIR64)/$(LIBLINKS): $(ROOTLIBDIR64)/$(LIBLINKS)$(VERS)
62	$(INS.liblink64)
63
64$(ROOTLIBDIR)/$(LIBLINKSCCC): $(ROOTLIBDIR)/$(LIBLINKSCCC)$(VERS)
65	$(INS.liblinkccc)
66$(ROOTLIBDIR64)/$(LIBLINKSCCC): $(ROOTLIBDIR64)/$(LIBLINKSCCC)$(VERS)
67	$(INS.liblinkccc64)
68
69$(ROOTLINTDIR)/%: $(SRCDIR)/%
70	$(INS.file)
71$(ROOTFS_LINTDIR)/%: $(SRCDIR)/%
72	$(INS.file)
73
74$(ROOTDEMODIRS):
75	$(INS.dir)
76$(ROOTDEMODIRBASE)/%: $(DEMOFILESRCDIR)/%
77	$(INS.file)
78
79objs/%.o pics/%.o: $(SRCDIR)/%.c
80	$(COMPILE.c) -o $@ $<
81	$(POST_PROCESS_O)
82
83objs/%.o pics/%.o: $(SRCDIR)/%.cc
84	$(COMPILE.cc) -o $@ $<
85	$(POST_PROCESS_O)
86
87objs pics:
88	-@mkdir -p $@
89
90$(LIBRARY): objs .WAIT $$(OBJS)
91	$(BUILD.AR)
92	$(POST_PROCESS_A)
93
94$(DYNLIB): $$(MAPFILES)
95
96$(DYNLIB): pics .WAIT $$(PICS) $$(ALTPICS)
97	$(BUILD.SO)
98	$(POST_PROCESS_SO)
99
100$(DYNLIBCCC): pics .WAIT $$(PICS) $$(ALTPICS)
101	$(BUILDCCC.SO)
102	$(POST_PROCESS_SO)
103
104fnamecheck: $(DYNLIB)
105	$(CHECK_FNAMES) -s $(C_SYNONYMS_H) -l $(DYNLIB) $(PICS) $(ALTPICS)
106
107$(LINTLIB): $$(SRCS)
108	$(LINT.c) -o $(LIBNAME) $(SRCS) > $(LINTOUT) 2>&1
109
110lintcheck: $$(SRCS)
111	$(LINT.c) $(LINTCHECKFLAGS) $(SRCS) $(LDLIBS)
112
113clobber: clean
114	-$(RM) $(CLOBBERTARGFILES)
115
116clean:
117	-$(RM) $(OBJS)
118	-$(RM) $(PICS) $(DUPLICATE_SRC) $(LINTOUT) $(LINTLIB) $(CLEANFILES)
119