xref: /titanic_41/usr/src/cmd/expr/Makefile (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27
28PROG= expr
29XPG4PROG= expr
30XPG6PROG= expr
31
32EXPROBJ= exprobjs/expr.o exprobjs/compile.o
33XPG4EXPROBJ= exprobjs.xpg4/expr.o exprobjs.xpg4/compile.o
34XPG6EXPROBJ= exprobjs.xpg6/expr.o exprobjs.xpg6/compile.o
35
36OBJS= $(EXPROBJ) $(XPG4EXPROBJ) $(XPG6EXPROBJ)
37SRCS= expr.c compile.c
38
39include ../Makefile.cmd
40
41CFLAGS += $(CCVERBOSE)
42$(XPG4) := CFLAGS += -DXPG4
43$(XPG6) := CFLAGS += -DXPG6
44
45# This flag is being added only for SCO (x86) compatibility
46CFLAGS += $(iBCS2FLAG)
47
48XGETFLAGS += -a -x expr.xcl
49
50LDLIBS += -lgen
51
52.KEEP_STATE:
53
54all: $(PROG) $(XPG4) $(XPG6)
55
56install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
57
58$(PROG): exprobjs $(EXPROBJ)
59	$(LINK.c) $(EXPROBJ) -o $@ $(LDLIBS)
60	$(POST_PROCESS)
61
62$(XPG4): exprobjs.xpg4 $(XPG4EXPROBJ)
63	$(LINK.c) $(XPG4EXPROBJ) -o $@ $(LDLIBS)
64	$(POST_PROCESS)
65
66$(XPG6): exprobjs.xpg6 $(XPG6EXPROBJ)
67	$(LINK.c) $(XPG6EXPROBJ) -o $@ $(LDLIBS)
68	$(POST_PROCESS)
69
70exprobjs/%.o:	%.c
71	$(COMPILE.c) -o $@ $<
72
73exprobjs.xpg4/%.o:	%.c
74	$(COMPILE.c) -o $@ $<
75
76exprobjs.xpg6/%.o:	%.c
77	$(COMPILE.c) -o $@ $<
78
79exprobjs:
80	-@mkdir -p $@
81
82exprobjs.xpg4:
83	-@mkdir -p $@
84
85exprobjs.xpg6:
86	-@mkdir -p $@
87
88clean:
89	$(RM) $(OBJS)
90
91lint:	lint_PROG
92
93include ../Makefile.targ
94