xref: /titanic_50/usr/src/cmd/expr/Makefile (revision 2df1fe9ca32bb227b9158c67f5c00b54c20b10fd)
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 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26
27PROG= expr
28XPG4PROG= expr
29XPG6PROG= expr
30
31EXPROBJ= exprobjs/expr.o exprobjs/compile.o
32XPG4EXPROBJ= exprobjs.xpg4/expr.o exprobjs.xpg4/compile.o
33XPG6EXPROBJ= exprobjs.xpg6/expr.o exprobjs.xpg6/compile.o
34
35OBJS= $(EXPROBJ) $(XPG4EXPROBJ) $(XPG6EXPROBJ)
36SRCS= expr.c compile.c
37
38include ../Makefile.cmd
39
40CFLAGS += $(CCVERBOSE)
41$(XPG4) := CFLAGS += -DXPG4
42$(XPG6) := CFLAGS += -DXPG6
43
44# This flag is being added only for SCO (x86) compatibility
45CFLAGS += $(iBCS2FLAG)
46
47XGETFLAGS += -a -x expr.xcl
48
49LDLIBS += -lgen
50
51MAPFILES =	$(MAPFILE.INT) $(MAPFILE.NGB)
52LDFLAGS +=	$(MAPFILES:%=-M%)
53
54.KEEP_STATE:
55
56all: $(PROG) $(XPG4) $(XPG6)
57
58install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
59
60$(PROG): exprobjs $(EXPROBJ) $(MAPFILES)
61	$(LINK.c) $(EXPROBJ) -o $@ $(LDLIBS)
62	$(POST_PROCESS)
63
64$(XPG4): exprobjs.xpg4 $(XPG4EXPROBJ) $(MAPFILES)
65	$(LINK.c) $(XPG4EXPROBJ) -o $@ $(LDLIBS)
66	$(POST_PROCESS)
67
68$(XPG6): exprobjs.xpg6 $(XPG6EXPROBJ) $(MAPFILES)
69	$(LINK.c) $(XPG6EXPROBJ) -o $@ $(LDLIBS)
70	$(POST_PROCESS)
71
72exprobjs/%.o:	%.c
73	$(COMPILE.c) -o $@ $<
74
75exprobjs.xpg4/%.o:	%.c
76	$(COMPILE.c) -o $@ $<
77
78exprobjs.xpg6/%.o:	%.c
79	$(COMPILE.c) -o $@ $<
80
81exprobjs:
82	-@mkdir -p $@
83
84exprobjs.xpg4:
85	-@mkdir -p $@
86
87exprobjs.xpg6:
88	-@mkdir -p $@
89
90clean:
91	$(RM) $(OBJS)
92
93lint:	lint_PROG
94
95include ../Makefile.targ
96