xref: /titanic_50/usr/src/cmd/sgs/lex/Makefile.targ (revision 8668df41d90e075636bc3817b28ad77cbd470959)
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/%_w.o pics/%_w.o objs/%_e.o pics/%_e.o:	../common/%.c
78	$(COMPILE.c) -o $@ $<
79	$(POST_PROCESS_O)
80
81objs/%.o pics/%.o:	../../whatdir/common/%.c
82	$(COMPILE.c) -o $@ $<
83	$(POST_PROCESS_O)
84
85objs/%.o pics/%.o:	../common/%.c
86	$(COMPILE.c) -o $@ $<
87	$(POST_PROCESS_O)
88
89# install rule for lint library target
90$(ROOTLINTDIR)/%: ../common/%
91	$(INS.file)
92
93$(DYNLINKLIBDIR)/%: %$(VERS)
94	$(INS.liblink)
95
96clean:
97	$(RM) $(POBJS) $(OBJS) $(PICS) $(CLEANFILES)
98
99lint: $(LINTPOUT) $(LINTLIB)
100
101$(LINTPOUT): $(SRCS)
102	$(LINT.c) $(SRCS) > $(LINTPOUT) 2>&1
103
104$(LINTLIB): $(LINTSRCS)
105	$(LINT.c) -o $(LIBNAME) $(LINTSRCS) > $(LINTOUT) 2>&1
106