xref: /titanic_41/usr/src/cmd/sgs/yacc/Makefile.targ (revision cb6207858a9fcc2feaee22e626912fba281ac969)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28$(PROG): objs .WAIT $(POBJS)
29	$(LINK.c) $(POBJS) -o $@ $(LDLIBS)
30	$(POST_PROCESS)
31
32$(ROOTCCSBIN)/%: ../common/%
33	$(INS.file)
34
35# conditional assignment of default permissions for the installed
36# DYNLIB/DYNLIBCCC.  Set here and in Makefile.mach, instead of Makefile.lib,
37# because ROOTLIBDIR may be changed in the including makefile after it has
38# included Makefile.lib.
39#
40$(ROOTLIBDIR)/$(DYNLIB) :=	FILEMODE= 755
41$(ROOTLIBDIR)/$(DYNLIBCCC) :=	FILEMODE= 755
42
43$(ROOTLIBDIR64)/$(DYNLIB) :=	FILEMODE= 755
44$(ROOTLIBDIR64)/$(DYNLIBCCC) :=	FILEMODE= 755
45
46# library install rules
47$(ROOTLIBDIR)/%: %
48	$(INS.file)
49$(ROOTLIBDIR64)/%: %
50	$(INS.file)
51
52$(ROOTLIBDIR)/$(LIBLINKS): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
53	$(INS.liblink)
54$(ROOTLIBDIR64)/$(LIBLINKS): $(ROOTLIBDIR64)/$(LIBLINKS)$(VERS)
55	$(INS.liblink64)
56
57$(ROOTLIBDIR)/$(LIBLINKSCCC): $(ROOTLIBDIR)/$(LIBLINKSCCC)$(VERS)
58	$(INS.liblinkccc)
59$(ROOTLIBDIR64)/$(LIBLINKSCCC): $(ROOTLIBDIR64)/$(LIBLINKSCCC)$(VERS)
60	$(INS.liblinkccc64)
61
62objs pics:
63	-@mkdir -p $@
64
65$(LIBRARY): objs .WAIT $$(OBJS)
66	$(BUILD.AR)
67	$(POST_PROCESS_A)
68
69$(DYNLIB): pics .WAIT $$(PICS)
70	$(BUILD.SO)
71	$(POST_PROCESS_SO)
72
73$(DYNLIBCCC): pics .WAIT $$(PICS)
74	$(BUILDCCC.SO)
75	$(POST_PROCESS_SO)
76
77objs/%.o pics/%.o:	../common/%.c
78	$(COMPILE.c) -o $@ $<
79	$(POST_PROCESS_O)
80
81objs/%.o pics/%.o:	../../whatdir/common/%.c
82	$(COMPILE.c) -o $@ $<
83
84# install rule for lint library target
85$(ROOTLINTDIR)/%: ../common/%
86	$(INS.file)
87
88$(DYNLINKLIBDIR)/%: %$(VERS)
89	$(INS.liblink)
90
91clean:
92		$(RM) $(POBJS) $(OBJS) $(PICS) $(CLEANFILES)
93
94lint:		$(LINTPOUT) $(LINTLIB)
95
96$(LINTPOUT):	$(SRCS)
97		$(LINT.c) $(SRCS) > $(LINTPOUT) 2>&1
98
99$(LINTLIB):	$(LINTSRCS)
100		$(LINT.c) -o $(LIBNAME) $(LINTSRCS) > $(LINTOUT) 2>&1
101