xref: /titanic_50/usr/src/cmd/expr/Makefile (revision 1886f67eb9de99edbcda88765f2c603a30c87fc2)
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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23#
24
25PROG= expr
26XPG4PROG= expr
27XPG6PROG= expr
28
29EXPROBJ= exprobjs/expr.o exprobjs/compile.o
30XPG4EXPROBJ= exprobjs.xpg4/expr.o exprobjs.xpg4/compile.o
31XPG6EXPROBJ= exprobjs.xpg6/expr.o exprobjs.xpg6/compile.o
32
33OBJS= $(EXPROBJ) $(XPG4EXPROBJ) $(XPG6EXPROBJ)
34SRCS= expr.c compile.c
35
36include ../Makefile.cmd
37
38CFLAGS += $(CCVERBOSE)
39CERRWARN += -_gcc=-Wno-uninitialized
40CERRWARN += -_gcc=-Wno-extra
41$(XPG4) := CFLAGS += -DXPG4
42$(XPG6) := CFLAGS += -DXPG6
43
44XGETFLAGS += -a -x expr.xcl
45
46LDLIBS += -lgen
47
48MAPFILES =	$(MAPFILE.INT) $(MAPFILE.NGB)
49LDFLAGS +=	$(MAPFILES:%=-M%)
50
51.KEEP_STATE:
52
53all: $(PROG) $(XPG4) $(XPG6)
54
55install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
56
57$(PROG): exprobjs $(EXPROBJ) $(MAPFILES)
58	$(LINK.c) $(EXPROBJ) -o $@ $(LDLIBS)
59	$(POST_PROCESS)
60
61$(XPG4): exprobjs.xpg4 $(XPG4EXPROBJ) $(MAPFILES)
62	$(LINK.c) $(XPG4EXPROBJ) -o $@ $(LDLIBS)
63	$(POST_PROCESS)
64
65$(XPG6): exprobjs.xpg6 $(XPG6EXPROBJ) $(MAPFILES)
66	$(LINK.c) $(XPG6EXPROBJ) -o $@ $(LDLIBS)
67	$(POST_PROCESS)
68
69exprobjs/%.o:	%.c
70	$(COMPILE.c) -o $@ $<
71
72exprobjs.xpg4/%.o:	%.c
73	$(COMPILE.c) -o $@ $<
74
75exprobjs.xpg6/%.o:	%.c
76	$(COMPILE.c) -o $@ $<
77
78exprobjs:
79	-@mkdir -p $@
80
81exprobjs.xpg4:
82	-@mkdir -p $@
83
84exprobjs.xpg6:
85	-@mkdir -p $@
86
87clean:
88	$(RM) $(OBJS)
89
90lint:	lint_PROG
91
92include ../Makefile.targ
93