xref: /titanic_50/usr/src/cmd/ndmpd/Makefile (revision 4558d122136f151d62acbbc02ddb42df89a5ef66)
1#
2# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
3#
4
5#
6# BSD 3 Clause License
7#
8# Copyright (c) 2007, The Storage Networking Industry Association.
9#
10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions
12# are met:
13# 	- Redistributions of source code must retain the above copyright
14#	  notice, this list of conditions and the following disclaimer.
15#
16# 	- Redistributions in binary form must reproduce the above copyright
17#	  notice, this list of conditions and the following disclaimer in
18#	  the documentation and/or other materials provided with the
19#	  distribution.
20#
21#	- Neither the name of The Storage Networking Industry Association (SNIA)
22#	  nor the names of its contributors may be used to endorse or promote
23#	  products derived from this software without specific prior written
24#	  permission.
25#
26# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36# POSSIBILITY OF SUCH DAMAGE.
37#
38PROG = ndmpd
39
40include $(SRC)/cmd/Makefile.cmd
41
42NDMP_DIR = ndmp
43TLM_DIR = tlm
44
45include $(NDMP_DIR)/Makefile.rpcgen
46
47CFLAGS += $(CCVERBOSE)
48
49CPPFLAGS += $(LFLAGS64)
50
51CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DDEBUG
52CPPFLAGS += -I. -Iinclude
53
54C99MODE = $(C99_ENABLE)
55
56# lint does not like unused _umem_*_init
57LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
58
59# function argument declared inconsistently
60LINTFLAGS += -xerroff=E_INCONS_ARG_DECL2
61# value type used inconsistently
62LINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_USED2
63# value type declared inconsistently
64LINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2
65# argument used inconsistently
66LINTFLAGS += -xerroff=E_INCONS_ARG_USED2
67
68LDLIBS   += -lsocket -lnsl -lzfs -lsec -lndmp -lmd5 -lnvpair -lumem -lbsm -lgen -lcmdutils
69
70OBJS= \
71	$(NDMP_DIR)/ndmp_xdr.o \
72	$(NDMP_OBJ:%.o=$(NDMP_DIR)/%.o) $(TLM_OBJ:%.o=$(TLM_DIR)/%.o)
73
74NDMP_OBJ = \
75	ndmpd_callbacks.o \
76	ndmpd_chkpnt.o \
77	ndmpd_comm.o \
78	ndmpd_config.o \
79	ndmpd_connect.o \
80	ndmpd_data.o \
81	ndmpd_door.o \
82	ndmpd_dtime.o \
83	ndmpd_fhistory.o \
84	ndmpd_handler.o \
85	ndmpd_log.o \
86	ndmpd_main.o \
87	ndmpd_mark.o \
88	ndmpd_mover.o \
89	ndmpd_prop.o \
90	ndmpd_scsi.o \
91	ndmpd_tape.o \
92	ndmpd_tar.o \
93	ndmpd_tar3.o \
94	ndmpd_util.o \
95	ndmpd_zfs.o
96
97TLM_OBJ = \
98	tlm_backup_reader.o \
99	tlm_bitmap.o \
100	tlm_buffers.o \
101	tlm_info.o \
102	tlm_init.o \
103	tlm_lib.o \
104	tlm_restore_writer.o \
105	tlm_traverse.o \
106	tlm_util.o \
107	tlm_hardlink.o
108
109SRCS= $(NDMP_OBJ:%.o=$(NDMP_DIR)/%.c) $(TLM_OBJ:%.o=$(TLM_DIR)/%.c)
110
111SVCMETHOD = svc-ndmp
112$(ROOTSVCMETHOD) := FILEMODE = 0555
113
114MANIFEST = ndmp.xml
115ROOTMANIFESTDIR= $(ROOTSVCSYSTEM)
116$(ROOTMANIFEST) := FILEMODE = 444
117
118ROOTNDMPDDIR=	$(ROOTLIB)/ndmp
119ROOTNDMPDFILE = $(PROG:%=$(ROOTNDMPDDIR)/%)
120
121FILEMODE = 0444
122$(ROOTNDMPDFILE):= FILEMODE = 0555
123
124$(ROOTNDMPDDIR):
125	$(INS.dir)
126
127$(ROOTNDMPDDIR)/%: %
128	$(INS.file)
129
130.KEEP_STATE:
131
132all: $(PROG)
133
134install: all $(ROOTNDMPDDIR)  $(ROOTNDMPDFILE) $(ROOTSVCMETHOD) $(ROOTMANIFEST)
135
136check:	$(CHKMANIFEST)
137
138clobber:
139
140$(PROG) : $(OBJS)
141	$(LINK.c) -o $@  $(OBJS) $(LDLIBS)
142	$(POST_PROCESS)
143
144$(NDMP_DIR)/%.o : $(NDMP_DIR)/%.c
145	$(COMPILE.c) -o $@ $<
146
147$(TLM_DIR)/%.o : $(TLM_DIR)/%.c
148	$(COMPILE.c) -o $@ $<
149
150lint:	lint_SRCS
151
152clean:  rpcclean
153	rm -f $(NDMP_DIR)/*.o $(TLM_DIR)/*.o
154
155include $(SRC)/cmd/Makefile.targ
156