xref: /titanic_50/usr/src/cmd/awk/Makefile (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
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 2005 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/awk/Makefile
29#
30
31# NOTE: awk is oawk.
32
33PROG= nawk
34
35OBJ1= b.o lib.o main.o parse.o proctab.o run.o tran.o
36OBJ2= awk.g.o awk.lx.o
37OBJS= $(OBJ2) $(OBJ1)
38SRCS= $(OBJ1:%.o=%.c)
39
40include ../Makefile.cmd
41#
42# Message catalog
43#
44POFILES= $(OBJS:%.o=%.po)
45POFILE= awk.po
46XGETFLAGS += -a -x awk.xcl
47#
48
49CPPFLAGS += -D_FILE_OFFSET_BITS=64
50YFLAGS += -d
51LDLIBS += -lm
52LINTFLAGS += -u
53CLEANFILES= maketab proctab.c awk.g.c awk.lx.c y.tab.h
54
55.KEEP_STATE:
56
57all: $(PROG)
58
59$(PROG): $(OBJS)
60	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
61	$(POST_PROCESS)
62
63#
64# message catalog
65#
66
67$(POFILE):  y.tab.h $(POFILES)
68	$(RM) $@
69	cat $(POFILES) > $@
70#
71
72proctab.c: maketab
73	rm -f $@; ./maketab > $@
74
75maketab: maketab.c
76	$(NATIVECC) -O maketab.c -o $@ $(LDLIBS)
77
78install: all $(ROOTPROG) $(ROOTLINK)
79
80clean:
81	$(RM) $(OBJS) $(CLEANFILES)
82
83lint: awk.g.c lint_SRCS
84
85awk.g.c + y.tab.h: awk.g.y
86
87awk.g.o: awk.g.c
88
89awk.lx.c: awk.lx.l
90
91proctab.o: proctab.c
92	$(COMPILE.c) proctab.c
93	$(POST_PROCESS_O)
94
95include ../Makefile.targ
96