xref: /titanic_52/usr/src/cmd/svc/startd/Makefile (revision 6da3ec44392fc16382cd0b111cd37806ebf2fece)
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# Copyright 2016 Toomas Soome <tsoome@me.com>
25#
26
27PROG = svc.startd
28OBJS = \
29	contract.o \
30	deathrow.o \
31	dict.o \
32	env.o \
33	expand.o \
34	file.o \
35	fork.o \
36	graph.o \
37	libscf.o \
38	log.o \
39	method.o \
40	misc.o \
41	protocol.o \
42	restarter.o \
43	specials.o \
44	startd.o \
45	transition.o \
46	wait.o \
47	utmpx.o
48
49ALLOBJS = $(OBJS) \
50	proc.o \
51	manifest_hash.o
52
53SRCS = $(OBJS:%.o=%.c) \
54	proc.c \
55	../common/manifest_hash.c
56
57POFILES = $(OBJS:%.o=%.po) \
58	proc.po \
59	../common/manifest_hash.po
60
61include ../../Makefile.cmd
62include ../../Makefile.ctf
63
64ROOTCMDDIR=	$(ROOT)/lib/svc/bin
65
66$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
67CFLAGS += $(CCVERBOSE)
68CPPFLAGS += -I. -I../common
69
70CERRWARN += -_gcc=-Wno-parentheses
71CERRWARN += -_gcc=-Wno-unused-label
72CERRWARN += -_gcc=-Wno-switch
73CERRWARN += -_gcc=-Wno-uninitialized
74
75$(OBJS) := CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_REENTRANT
76
77proc.o := CPPFLAGS += -D_REENTRANT
78
79%.o:	../common/%.c
80	$(COMPILE.c) $(OUTPUT_OPTION) $<
81	$(POST_PROCESS_O)
82
83%.ln:	../common/%.c
84	$(LINT.c) $(OUTPUT_OPTION) -c $<
85
86LDLIBS += \
87	-lcontract \
88	-lkstat \
89	-lmd5 \
90	-lnvpair \
91	-lrestart \
92	-lscf \
93	-lsysevent \
94	-lumem \
95	-luutil
96
97LDLIBS_i386 +=	-lbe
98LDLIBS +=	$(LDLIBS_$(MACH)) -L $(ROOT)/lib/fm -lfmevent
99LDFLAGS +=	-R /lib/fm
100
101FILEMODE = 0555
102
103# lint doesn't like the unused _umem_*_init()
104# And lint thinks uadmin() is undefined.
105lint_SRCS := LINTFLAGS += -U_FILE_OFFSET_BITS -xerroff=E_NAME_DEF_NOT_USED2 -u
106lint_SRCS := CPPFLAGS += \
107	-I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64
108
109.KEEP_STATE:
110
111.PARALLEL: $(ALLOBJS)
112
113all: $(PROG)
114
115$(PROG): $(ALLOBJS)
116	$(LINK.c) -o $@ $(ALLOBJS) $(LDLIBS) $(LDFLAGS) $(CTFMERGE_HOOK)
117	$(POST_PROCESS)
118
119$(POFILE): $(POFILES)
120	cat $(POFILES) > $(POFILE)
121
122install: all $(ROOTCMD)
123
124clean:
125	$(RM) $(ALLOBJS)
126
127lint:   lint_SRCS
128
129include ../../Makefile.targ
130