xref: /titanic_51/usr/src/cmd/ndmpd/Makefile (revision b453864f3587ccc3324d7a3b0438a1e542dcfde7)
1#
2# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3# Use is subject to license terms.
4#
5
6#
7# BSD 3 Clause License
8#
9# Copyright (c) 2007, The Storage Networking Industry Association.
10#
11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions
13# are met:
14# 	- Redistributions of source code must retain the above copyright
15#	  notice, this list of conditions and the following disclaimer.
16#
17# 	- Redistributions in binary form must reproduce the above copyright
18#	  notice, this list of conditions and the following disclaimer in
19#	  the documentation and/or other materials provided with the
20#	  distribution.
21#
22#	- Neither the name of The Storage Networking Industry Association (SNIA)
23#	  nor the names of its contributors may be used to endorse or promote
24#	  products derived from this software without specific prior written
25#	  permission.
26#
27# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37# POSSIBILITY OF SUCH DAMAGE.
38#
39PROG = ndmpd
40
41include $(SRC)/cmd/Makefile.cmd
42
43NDMP_DIR = ndmp
44TLM_DIR = tlm
45
46include $(NDMP_DIR)/Makefile.rpcgen
47
48CFLAGS += $(CCVERBOSE)
49
50CPPFLAGS += $(LFLAGS64)
51
52CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DDEBUG
53CPPFLAGS += -I. -Iinclude
54
55C99MODE = $(C99_ENABLE)
56
57# lint does not like unused _umem_*_init
58LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
59
60# function argument declared inconsistently
61LINTFLAGS += -xerroff=E_INCONS_ARG_DECL2
62# value type used inconsistently
63LINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_USED2
64# value type declared inconsistently
65LINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2
66# argument used inconsistently
67LINTFLAGS += -xerroff=E_INCONS_ARG_USED2
68
69LDLIBS   += -lsocket -lnsl -lzfs -lsec -lndmp -lmd5 -lnvpair -lumem -lbsm -lgen -lcmdutils
70
71OBJS= \
72	$(NDMP_DIR)/ndmp_xdr.o \
73	$(NDMP_OBJ:%.o=$(NDMP_DIR)/%.o) $(TLM_OBJ:%.o=$(TLM_DIR)/%.o)
74
75NDMP_OBJ = \
76	ndmpd_callbacks.o \
77	ndmpd_chkpnt.o \
78	ndmpd_comm.o \
79	ndmpd_config.o \
80	ndmpd_connect.o \
81	ndmpd_data.o \
82	ndmpd_door.o \
83	ndmpd_dtime.o \
84	ndmpd_prop.o \
85	ndmpd_fhistory.o \
86	ndmpd_handler.o \
87	ndmpd_log.o \
88	ndmpd_main.o \
89	ndmpd_mark.o \
90	ndmpd_mover.o \
91	ndmpd_scsi.o \
92	ndmpd_tape.o \
93	ndmpd_tar.o \
94	ndmpd_tar3.o \
95	ndmpd_util.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