xref: /titanic_51/usr/src/cmd/svc/startd/Makefile (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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
29PROG = svc.startd
30OBJS = \
31	contract.o \
32	dict.o \
33	env.o \
34	expand.o \
35	file.o \
36	fork.o \
37	graph.o \
38	libscf.o \
39	log.o \
40	method.o \
41	misc.o \
42	protocol.o \
43	specials.o \
44	startd.o \
45	restarter.o \
46	wait.o \
47	utmpx.o
48
49ALLOBJS = $(OBJS) proc.o
50
51SRCS = $(OBJS:%.o=%.c)
52
53POFILES = $(ALLOBJS:%.o=%.po)
54
55include ../../Makefile.cmd
56include ../Makefile.ctf
57
58ROOTCMDDIR=	$(ROOT)/lib/svc/bin
59
60CFLAGS += -v
61
62$(OBJS) := CPPFLAGS += \
63	-I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64
64
65$(POFILE) := CPPFLAGS += -I. -I../common
66
67proc.o := CPPFLAGS += -I. -I../common -D_REENTRANT
68
69LDLIBS += \
70	-lcontract \
71	-lkstat \
72	-lnvpair \
73	-lrestart \
74	-lscf \
75	-lsysevent \
76	-lumem \
77	-luutil
78
79FILEMODE = 0555
80OWNER = root
81GROUP = sys
82
83# lint doesn't like the unused _umem_*_init()
84# And lint thinks uadmin() is undefined.
85lint_SRCS := LINTFLAGS += -U_FILE_OFFSET_BITS -xerroff=E_NAME_DEF_NOT_USED2 -u
86lint_SRCS := CPPFLAGS += \
87	-I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64
88
89.KEEP_STATE:
90
91.PARALLEL: $(ALLOBJS)
92
93all: $(PROG)
94
95$(PROG): $(ALLOBJS)
96	$(LINK.c) -o $@ $(ALLOBJS) $(LDLIBS) $(CTFMERGE_HOOK)
97	$(POST_PROCESS)
98
99$(POFILE): $(POFILES)
100	cat $(POFILES) > $(POFILE)
101
102install: all $(ROOTCMD)
103
104clean:
105	$(RM) $(ALLOBJS)
106
107lint:   lint_SRCS
108
109include ../../Makefile.targ
110