xref: /illumos-gate/usr/src/cmd/nohup/Makefile (revision 65bed588e62c7f3a0da5d65fcc588b46b470f5a7)
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
27XPG4PROG = nohup
28PROG = nohup
29OBJS = nohup.o
30XPG4OBJS = $(OBJS:%.o=xpg4_%.o)
31
32include ../Makefile.cmd
33include ../Makefile.cmd.64
34
35CLEANFILES += $(OBJS) $(XPG4OBJS)
36
37CFLAGS += $(CCVERBOSE)
38
39$(XPG4) := CPPFLAGS += -DXPG4
40
41# not needed for xpg4/nohup
42EXTRALIBS = -lproc
43
44ROOTLINK = $(PROG:%=$(ROOTBIN64)/%)
45
46.KEEP_STATE:
47
48.PARALLEL: $(OBJS) $(XPG4OBJS)
49
50all: $(PROG) $(XPG4)
51
52install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTLINK)
53
54clean:
55	$(RM) $(CLEANFILES)
56
57$(ROOTLINK):
58	$(RM) $@; $(SYMLINK) ../../bin/$(@F) $@
59
60$(PROG): $(OBJS)
61	$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(EXTRALIBS)
62	$(POST_PROCESS)
63
64$(XPG4): $(XPG4OBJS)
65	$(LINK.c) -o $@ $(XPG4OBJS) $(LDLIBS)
66	$(POST_PROCESS)
67
68xpg4_%.o: %.c
69	$(COMPILE.c) -o $@ $<
70	$(POST_PROCESS_O)
71
72include ../Makefile.targ
73