xref: /illumos-gate/usr/src/cmd/sgs/lex/Makefile.targ (revision 945e3b4bc345679cad92f0a896670030a411c8f8)
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 2015 Gary Mills
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
27#
28
29$(PROG): objs .WAIT $(POBJS)
30	$(LINK.c) $(POBJS) -o $@ $(LDLIBS)
31	$(POST_PROCESS)
32
33# conditional assignment of default permissions for the installed
34# DYNLIB/DYNLIBCCC.  Set here and in Makefile.mach, instead of Makefile.lib,
35# because ROOTLIBDIR may be changed in the including makefile after it has
36# included Makefile.lib.
37#
38$(ROOTLIBDIR)/$(DYNLIB) :=	FILEMODE= 755
39$(ROOTLIBDIR)/$(DYNLIBCCC) :=	FILEMODE= 755
40
41$(ROOTLIBDIR64)/$(DYNLIB) :=	FILEMODE= 755
42$(ROOTLIBDIR64)/$(DYNLIBCCC) :=	FILEMODE= 755
43
44# library install rules
45$(ROOTLIBDIR)/%: %
46	$(INS.file)
47$(ROOTLIBDIR64)/%: %
48	$(INS.file)
49
50$(ROOTLIBDIR)/$(LIBLINKS): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
51	$(INS.liblink)
52$(ROOTLIBDIR64)/$(LIBLINKS): $(ROOTLIBDIR64)/$(LIBLINKS)$(VERS)
53	$(INS.liblink64)
54
55$(ROOTLIBDIR)/$(LIBLINKSCCC): $(ROOTLIBDIR)/$(LIBLINKSCCC)$(VERS)
56	$(INS.liblinkccc)
57$(ROOTLIBDIR64)/$(LIBLINKSCCC): $(ROOTLIBDIR64)/$(LIBLINKSCCC)$(VERS)
58	$(INS.liblinkccc64)
59
60objs pics:
61	-@mkdir -p $@
62
63$(LIBRARY): objs .WAIT $$(OBJS)
64	$(BUILD.AR)
65	$(POST_PROCESS_A)
66
67$(DYNLIB): pics .WAIT $$(PICS)
68	$(BUILD.SO)
69	$(POST_PROCESS_SO)
70
71$(DYNLIBCCC): pics .WAIT $$(PICS)
72	$(BUILDCCC.SO)
73	$(POST_PROCESS_SO)
74
75objs/%_w.o pics/%_w.o objs/%_e.o pics/%_e.o:	../common/%.c
76	$(COMPILE.c) -o $@ $<
77	$(POST_PROCESS_O)
78
79objs/%.o pics/%.o:	../common/%.c
80	$(COMPILE.c) -o $@ $<
81	$(POST_PROCESS_O)
82
83$(DYNLINKLIBDIR)/%: %$(VERS)
84	$(INS.liblink)
85
86clean:
87	$(RM) $(POBJS) $(OBJS) $(PICS) $(CLEANFILES)
88