xref: /illumos-gate/usr/src/cmd/svc/startd/Makefile (revision e4f5a11d4a234623168c1558fcdf4341e11769e1)
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 2010 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26PROG = svc.startd
27OBJS = \
28	contract.o \
29	deathrow.o \
30	dict.o \
31	env.o \
32	expand.o \
33	file.o \
34	fork.o \
35	graph.o \
36	libscf.o \
37	log.o \
38	method.o \
39	misc.o \
40	protocol.o \
41	restarter.o \
42	specials.o \
43	startd.o \
44	transition.o \
45	wait.o \
46	utmpx.o
47
48ALLOBJS = $(OBJS) \
49	proc.o \
50	manifest_hash.o
51
52SRCS = $(OBJS:%.o=%.c) \
53	proc.c \
54	../common/manifest_hash.c
55
56POFILES = $(OBJS:%.o=%.po) \
57	proc.po \
58	../common/manifest_hash.po
59
60include ../../Makefile.cmd
61include ../../Makefile.ctf
62
63ROOTCMDDIR=	$(ROOT)/lib/svc/bin
64
65CFLAGS += -v
66CPPFLAGS += -I. -I../common
67
68$(OBJS) := CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_REENTRANT
69
70proc.o := CPPFLAGS += -D_REENTRANT
71
72%.o:	../common/%.c
73	$(COMPILE.c) $(OUTPUT_OPTION) $<
74	$(POST_PROCESS_O)
75
76%.ln:	../common/%.c
77	$(LINT.c) $(OUTPUT_OPTION) -c $<
78
79LDLIBS += \
80	-lcontract \
81	-lkstat \
82	-lmd5 \
83	-lnvpair \
84	-lrestart \
85	-lscf \
86	-lsysevent \
87	-lumem \
88	-luutil
89
90LDLIBS_i386 +=	-lgrubmgmt
91LDLIBS +=	$(LDLIBS_$(MACH))
92
93FILEMODE = 0555
94
95# lint doesn't like the unused _umem_*_init()
96# And lint thinks uadmin() is undefined.
97lint_SRCS := LINTFLAGS += -U_FILE_OFFSET_BITS -xerroff=E_NAME_DEF_NOT_USED2 -u
98lint_SRCS := CPPFLAGS += \
99	-I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64
100
101.KEEP_STATE:
102
103.PARALLEL: $(ALLOBJS)
104
105all: $(PROG)
106
107$(PROG): $(ALLOBJS)
108	$(LINK.c) -o $@ $(ALLOBJS) $(LDLIBS)
109	$(POST_PROCESS)
110
111$(POFILE): $(POFILES)
112	cat $(POFILES) > $(POFILE)
113
114install: all $(ROOTCMD)
115
116clean:
117	$(RM) $(ALLOBJS)
118
119lint:   lint_SRCS
120
121include ../../Makefile.targ
122