xref: /illumos-gate/usr/src/cmd/nl/Makefile (revision 03831d35f7499c87d51205817c93e9a8d42c4bae)
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# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# cmd/nl/Makefile
29#
30# Message catalog requires no special processing because messages
31# only occur in ./nl.c, not in ../expr/compile.c.
32
33PROG= nl
34XPG4PROG= nl
35
36NLOBJ= nlobjs/$(PROG).o nlobjs/compile.o
37XPG4NLOBJ= nlobjs.xpg4/$(PROG).o nlobjs.xpg4/compile.o
38
39OBJS = $(NLOBJ) $(XPG4NLOBJ)
40SRCS = nl.c ../expr/compile.c
41
42include ../Makefile.cmd
43
44LDLIBS += -lgen
45CFLAGS += $(CCVERBOSE)
46$(XPG4):= CPPFLAGS += -DXPG4
47
48.KEEP_STATE:
49
50all: $(PROG) $(XPG4)
51
52install: all $(ROOTPROG) $(ROOTXPG4PROG)
53
54$(PROG): nlobjs $(NLOBJ)
55	$(LINK.c) $(NLOBJ) -o $@ $(LDLIBS)
56	$(POST_PROCESS)
57
58$(XPG4): nlobjs.xpg4 $(XPG4NLOBJ)
59	$(LINK.c) $(XPG4NLOBJ) -o $@ $(LDLIBS)
60	$(POST_PROCESS)
61
62nlobjs/%.o:   %.c
63	$(COMPILE.c) -o $@ $<
64
65nlobjs/%.o:   ../expr/%.c
66	$(COMPILE.c) -o $@ $<
67
68nlobjs.xpg4/%.o:      %.c
69	$(COMPILE.c) -o $@ $<
70
71nlobjs.xpg4/%.o:      ../expr/%.c
72	$(COMPILE.c) -o $@ $<
73
74nlobjs:
75	-@mkdir -p $@
76
77nlobjs.xpg4:
78	-@mkdir -p $@
79
80clean:
81	$(RM) $(OBJS)
82
83lint:	lint_PROG
84
85include ../Makefile.targ
86
87