xref: /illumos-gate/usr/src/lib/Makefile.targ (revision 90f7985f020eb82d06bd0d75396ff794105f7528)
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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright (c) 2019, Joyent, Inc.
24#
25
26#
27# included to define local library targets
28#
29
30# conditional assignment of default permissions for the installed
31# DYNLIB/DYNLIBCCC.  Set here and in Makefile.mach, instead of Makefile.lib,
32# because ROOTLIBDIR may be changed in the including makefile after it has
33# included Makefile.lib.
34#
35$(ROOTLIBDIR)/$(DYNLIB) :=	FILEMODE= 755
36$(ROOTLIBDIR)/$(DYNLIBCCC) :=	FILEMODE= 755
37
38$(ROOTFS_LIBDIR)/$(DYNLIB) :=	FILEMODE= 755
39$(ROOTFS_LIBDIR)/$(DYNLIBCCC) :=	FILEMODE= 755
40
41$(ROOTLIBDIR64)/$(DYNLIB) :=	FILEMODE= 755
42$(ROOTLIBDIR64)/$(DYNLIBCCC) :=	FILEMODE= 755
43
44# install rules
45$(ROOTHDRDIR)/%: $(HDRDIR)/%
46	$(INS.file)
47
48$(ROOTLIBDIR)/%: %
49	$(INS.file)
50$(ROOTLIBDIR64)/%: %
51	$(INS.file)
52$(ROOTFS_LIBDIR)/%: %
53	$(INS.file)
54$(ROOTFS_LIBDIR64)/%: %
55	$(INS.file)
56
57$(ROOTLIBDIR)/$(LIBLINKS): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
58	$(INS.liblink)
59$(ROOTLIBDIR64)/$(LIBLINKS): $(ROOTLIBDIR64)/$(LIBLINKS)$(VERS)
60	$(INS.liblink64)
61
62$(ROOTLIBDIR)/$(LIBLINKSCCC): $(ROOTLIBDIR)/$(LIBLINKSCCC)$(VERS)
63	$(INS.liblinkccc)
64$(ROOTLIBDIR64)/$(LIBLINKSCCC): $(ROOTLIBDIR64)/$(LIBLINKSCCC)$(VERS)
65	$(INS.liblinkccc64)
66
67$(ROOTDEMODIRS):
68	$(INS.dir)
69$(ROOTDEMODIRBASE)/%: $(DEMOFILESRCDIR)/%
70	$(INS.file)
71
72objs/%.o pics/%.o: $(SRCDIR)/%.c
73	$(COMPILE.c) -o $@ $<
74	$(POST_PROCESS_O)
75
76objs/%.o pics/%.o: $(SRCDIR)/%.cc
77	$(COMPILE.cc) -o $@ $<
78	$(POST_PROCESS_CC_O)
79
80objs pics:
81	-@mkdir -p $@
82
83$(LIBRARY): objs .WAIT $$(OBJS)
84	$(BUILD.AR)
85	$(POST_PROCESS_A)
86
87$(DYNLIB): $$(MAPFILES)
88
89$(DYNLIB): pics .WAIT $$(PICS) $$(ALTPICS) $$(EXTPICS)
90	$(BUILD.SO)
91	$(POST_PROCESS_SO)
92
93$(DYNLIBCCC): pics .WAIT $$(PICS) $$(ALTPICS) $$(EXTPICS)
94	$(BUILDCCC.SO)
95	$(POST_PROCESS_SO)
96
97$(TYPECHECK): $(TYPECHECK_LIB32) $(TYPECHECK_LIB64)
98	$(TYPECHECK.lib)
99
100clobber: clean
101	-$(RM) $(CLOBBERTARGFILES)
102
103clean:
104	-$(RM) $(OBJS) $(PICS) $(DUPLICATE_SRC) $(CLEANFILES)
105
106$(ROOTCOMPATLINKS):
107	$(RM) $@; $(SYMLINK) $(COMPATLINKTARGET) $@
108
109$(ROOTCOMPATLINKS64):
110	$(RM) $@; $(SYMLINK) $(COMPATLINKTARGET) $@
111
112