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