xref: /titanic_52/usr/src/cmd/expr/Makefile (revision f6e214c7418f43af38bd8c3a557e3d0a1d311cfa)
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)
39$(XPG4) := CFLAGS += -DXPG4
40$(XPG6) := CFLAGS += -DXPG6
41
42XGETFLAGS += -a -x expr.xcl
43
44LDLIBS += -lgen
45
46MAPFILES =	$(MAPFILE.INT) $(MAPFILE.NGB)
47LDFLAGS +=	$(MAPFILES:%=-M%)
48
49.KEEP_STATE:
50
51all: $(PROG) $(XPG4) $(XPG6)
52
53install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
54
55$(PROG): exprobjs $(EXPROBJ) $(MAPFILES)
56	$(LINK.c) $(EXPROBJ) -o $@ $(LDLIBS)
57	$(POST_PROCESS)
58
59$(XPG4): exprobjs.xpg4 $(XPG4EXPROBJ) $(MAPFILES)
60	$(LINK.c) $(XPG4EXPROBJ) -o $@ $(LDLIBS)
61	$(POST_PROCESS)
62
63$(XPG6): exprobjs.xpg6 $(XPG6EXPROBJ) $(MAPFILES)
64	$(LINK.c) $(XPG6EXPROBJ) -o $@ $(LDLIBS)
65	$(POST_PROCESS)
66
67exprobjs/%.o:	%.c
68	$(COMPILE.c) -o $@ $<
69
70exprobjs.xpg4/%.o:	%.c
71	$(COMPILE.c) -o $@ $<
72
73exprobjs.xpg6/%.o:	%.c
74	$(COMPILE.c) -o $@ $<
75
76exprobjs:
77	-@mkdir -p $@
78
79exprobjs.xpg4:
80	-@mkdir -p $@
81
82exprobjs.xpg6:
83	-@mkdir -p $@
84
85clean:
86	$(RM) $(OBJS)
87
88lint:	lint_PROG
89
90include ../Makefile.targ
91