xref: /titanic_41/usr/src/lib/libcmd/Makefile.com (revision 3fb517f786391b507780c78aabb8d98bfea9efe9)
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#
23# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24#
25
26
27SHELL=/usr/bin/ksh93
28
29LIBRARY =	libcmd.a
30VERS =		.1
31OBJECTS =	\
32	basename.o \
33	cat.o \
34	chgrp.o \
35	cksum.o \
36	chmod.o \
37	chown.o \
38	cmdinit.o \
39	cmp.o \
40	comm.o \
41	cp.o \
42	cut.o \
43	date.o \
44	dirname.o \
45	expr.o \
46	grep.o \
47	fds.o \
48	fmt.o \
49	fold.o \
50	fts_fix.o \
51	getconf.o \
52	head.o \
53	id.o \
54	join.o \
55	ln.o \
56	logname.o \
57	md5sum.o \
58	mkdir.o \
59	mkfifo.o \
60	mktemp.o \
61	mv.o \
62	paste.o \
63	pathchk.o \
64	pids.o \
65	readlink.o \
66	rev.o \
67	revlib.o \
68	rm.o \
69	rmdir.o \
70	stty.o \
71	sum.o \
72	sync.o \
73	tail.o \
74	tee.o \
75	tty.o \
76	uname.o \
77	uniq.o \
78	vmstate.o \
79	wc.o \
80	wclib.o
81
82include ../../Makefile.astmsg
83
84include ../../Makefile.lib
85
86# mapfile-vers does not live with the sources in in common/ to make
87# automated code updates easier.
88MAPFILES=       ../mapfile-vers
89
90# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
91include ../../../Makefile.ast
92
93LIBS =		$(DYNLIB) $(LINTLIB)
94
95$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
96
97LDLIBS += \
98	-lsum \
99	-last \
100	-lsocket \
101	-lnsl \
102	-lc
103
104SRCDIR =	../common
105
106# We use "=" here since using $(CPPFLAGS.master) is very tricky in our
107# case - it MUST come as the last element but future changes in -D options
108# may then cause silent breakage in the AST sources because the last -D
109# option specified overrides previous -D options so we prefer the current
110# way to explicitly list each single flag.
111# Notes:
112#   - "-D_BLD_DLL" comes from ${mam_cc_DLL} in Mamfile
113CPPFLAGS = \
114	$(DTEXTDOM) $(DTS_ERRNO) \
115	-I../common \
116	-Isrc/lib/libcmd \
117	-I$(ROOT)/usr/include/ast \
118	-I$(ROOT)/usr/include \
119	-D_BLD_cmd \
120	-D_PACKAGE_ast \
121	-D_BLD_DLL \
122	'-DERROR_CATALOG="libcmd"' \
123	'-DUSAGE_LICENSE=\
124		"[-author?Glenn Fowler <gsf@research.att.com>]"\
125		"[-author?David Korn <dgk@research.att.com>]"\
126		"[-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property]"\
127		"[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
128		"[--catalog?libcmd]"'
129
130CFLAGS += \
131	$(ASTCFLAGS)
132CFLAGS64 += \
133	$(ASTCFLAGS64)
134
135pics/cut.o	:= CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED
136pics/sync.o	:= CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED
137pics/vmstate.o	:= CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
138
139.KEEP_STATE:
140
141all: $(LIBS)
142
143#
144# libcmd is not lint-clean yet; fake up a target.  (You can use
145# "make lintcheck" to actually run lint; please send all lint fixes
146# upstream (to AT&T) so the next update will pull them into ON.)
147#
148lint:
149	@ print "usr/src/lib/libcmd is not lint-clean: skipping"
150
151include ../../Makefile.targ
152