xref: /illumos-gate/usr/src/cmd/isns/isnsd/Makefile (revision b9538c2103fde34bfe8a8c2b3e878ecd1586d182)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26#
27# Copyright (c) 2012 by Delphix. All rights reserved.
28# Copyright 2017 Joyent, Inc.
29#
30
31PROG = isns
32
33DSRC = isns_provider.d
34DTRACE_HEADER = $(DSRC:%.d=%.h)
35
36COBJS	= main.o qry.o admintf.o dsapi.o log.o sched.o dseng.o scn.o cache.o
37COBJS	+= dump.o msgq.o server.o config.o esi.o obj.o utils.o dd.o func.o
38COBJS	+= pdu.o door.o htable.o
39OBJS	= $(COBJS) $(DSRC:%.d=%.o)
40SRCS	= $(COBJS:%.o=%.c)
41POFILE= isns.po
42POFILES	= $(COBJS:%.o=%.po)
43
44include ../../Makefile.cmd
45
46DATA_STORE	= xml
47XML_DIR		= xml_def
48ISNS_SVC	= $(XML_DIR)/isns_server.xml
49
50MANIFEST	= isns_server.xml
51ROOTMANIFESTDIR	= $(ROOTSVCNETWORK)
52$(ROOTSVCNETWORK)/isns_server.xml	:= FILEMODE = 0444
53
54CFLAGS 		+=	$(CCVERBOSE)
55CPPFLAGS 	+= -I./ -I$(ADJUNCT_PROTO)/usr/include/libxml2
56CPPFLAGS	+= -DTARGET_DATA_STORE=$(DATA_STORE)
57CPPFLAGS	+= -D_POSIX_PTHREAD_SEMANTICS
58LINTFLAGS += -xerroff=E_BAD_PTR_CAST_ALIGN
59LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
60LINTFLAGS += -xerroff=E_CASE_FALLTHRU
61
62CERRWARN += -_gcc=-Wno-char-subscripts
63CERRWARN += -_gcc=-Wno-ignored-qualifiers
64CERRWARN += -_gcc=-Wno-uninitialized
65CERRWARN += -_gcc=-Wno-implicit-function-declaration
66
67CLOBBERFILES += $(DTRACE_HEADER)
68
69obj.o := CERRWARN += -erroff=E_CONST_OBJ_SHOULD_HAVE_INITIZR
70obj.o := CERRWARN += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT
71
72LDLIBS		+= -lsecdb -lsocket -lnsl -lscf -lxml2
73
74.KEEP_STATE:
75
76all:	$(PROG)
77
78$(PROG): $(OBJS)
79	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
80	$(POST_PROCESS)
81
82%.h: %.d
83	$(DTRACE) -h -s $< -o $@
84
85%.o:	%.c $(DTRACE_HEADER)
86	$(COMPILE.c) $<
87	$(POST_PROCESS_O)
88
89%.o:	%.d $(COBJS)
90	$(COMPILE.d) -s $< $(COBJS)
91	$(POST_PROCESS_O)
92
93clean:
94	$(RM) $(OBJS)
95
96lint:	lint_SRCS
97
98$(POFILES): $(DTRACE_HEADER)
99
100$(POFILE): $(POFILES)
101	$(RM) $@
102	$(CAT) $(POFILES) > $@
103
104check:	$(CHKMANIFEST)
105
106include ../../Makefile.targ
107
108install: all .WAIT $(ROOTUSRSBINPROG) $(ROOTMANIFEST)
109