xref: /titanic_44/usr/src/cmd/svc/startd/Makefile (revision 6ed9368a130d7c9a82e574da808d34034da33748)
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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2012 Milan Jurik. All rights reserved.
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
65$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
66CFLAGS += $(CCVERBOSE)
67CPPFLAGS += -I. -I../common
68
69CERRWARN += -_gcc=-Wno-parentheses
70CERRWARN += -_gcc=-Wno-unused-label
71CERRWARN += -_gcc=-Wno-switch
72CERRWARN += -_gcc=-Wno-uninitialized
73
74$(OBJS) := CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_REENTRANT
75
76proc.o := CPPFLAGS += -D_REENTRANT
77
78%.o:	../common/%.c
79	$(COMPILE.c) $(OUTPUT_OPTION) $<
80	$(POST_PROCESS_O)
81
82%.ln:	../common/%.c
83	$(LINT.c) $(OUTPUT_OPTION) -c $<
84
85LDLIBS += \
86	-lcontract \
87	-lkstat \
88	-lmd5 \
89	-lnvpair \
90	-lrestart \
91	-lscf \
92	-lsysevent \
93	-lumem \
94	-luutil
95
96LDLIBS_i386 +=	-lgrubmgmt
97LDLIBS +=	$(LDLIBS_$(MACH)) -L $(ROOT)/lib/fm -lfmevent
98LDFLAGS +=	-R /lib/fm
99
100FILEMODE = 0555
101
102# lint doesn't like the unused _umem_*_init()
103# And lint thinks uadmin() is undefined.
104lint_SRCS := LINTFLAGS += -U_FILE_OFFSET_BITS -xerroff=E_NAME_DEF_NOT_USED2 -u
105lint_SRCS := CPPFLAGS += \
106	-I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64
107
108.KEEP_STATE:
109
110.PARALLEL: $(ALLOBJS)
111
112all: $(PROG)
113
114$(PROG): $(ALLOBJS)
115	$(LINK.c) -o $@ $(ALLOBJS) $(LDLIBS) $(LDFLAGS) $(CTFMERGE_HOOK)
116	$(POST_PROCESS)
117
118$(POFILE): $(POFILES)
119	cat $(POFILES) > $(POFILE)
120
121install: all $(ROOTCMD)
122
123clean:
124	$(RM) $(ALLOBJS)
125
126lint:   lint_SRCS
127
128include ../../Makefile.targ
129