Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# BSD 3 Clause License
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright (c) 2007, The Storage Networking Industry Association.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Redistribution and use in source and binary forms, with or without
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# modification, are permitted provided that the following conditions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# are met:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# - Redistributions of source code must retain the above copyright
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# notice, this list of conditions and the following disclaimer.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# - Redistributions in binary form must reproduce the above copyright
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# notice, this list of conditions and the following disclaimer in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the documentation and/or other materials provided with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# distribution.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# - Neither the name of The Storage Networking Industry Association (SNIA)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# nor the names of its contributors may be used to endorse or promote
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# products derived from this software without specific prior written
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater# permission.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# POSSIBILITY OF SUCH DAMAGE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPROG = ndmpd
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(SRC)/cmd/Makefile.cmd
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsNDMP_DIR = ndmp
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserTLM_DIR = tlm
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userinclude $(NDMP_DIR)/Makefile.rpcgen
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCFLAGS += $(CCVERBOSE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCPPFLAGS += $(LFLAGS64)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCPPFLAGS += -D_FILE_OFFSET_BITS=64 -DDEBUG
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCPPFLAGS += -I. -Iinclude
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsC99MODE = $(C99_ENABLE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# lint does not like unused _umem_*_init
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntLINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# function argument declared inconsistently
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINTFLAGS += -xerroff=E_INCONS_ARG_DECL2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# value type used inconsistently
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserLINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_USED2
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User# value type declared inconsistently
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserLINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User# argument used inconsistently
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntLINTFLAGS += -xerroff=E_INCONS_ARG_USED2
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCERRWARN += -_gcc=-Wno-unused-variable
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCERRWARN += -_gcc=-Wno-switch
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCERRWARN += -_gcc=-Wno-uninitialized
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCERRWARN += -_gcc=-Wno-address
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLDLIBS += -lsocket -lnsl -lzfs -lsec -lndmp -lmd5 -lnvpair -lumem -lbsm -lgen -lcmdutils -linetutil
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsOBJS= \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(NDMP_DIR)/ndmp_xdr.o \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(NDMP_OBJ:%.o=$(NDMP_DIR)/%.o) $(TLM_OBJ:%.o=$(TLM_DIR)/%.o)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsNDMP_OBJ = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ndmpd_callbacks.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_chkpnt.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_comm.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_config.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_connect.o \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ndmpd_data.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_door.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_dtime.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_fhistory.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_handler.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_log.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_main.o \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ndmpd_mark.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_mover.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_prop.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_scsi.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_tape.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_tar.o \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ndmpd_tar3.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ndmpd_util.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User ndmpd_zfs.o
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserTLM_OBJ = \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User tlm_backup_reader.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User tlm_bitmap.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User tlm_buffers.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User tlm_info.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User tlm_init.o \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews tlm_lib.o \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User tlm_restore_writer.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User tlm_traverse.o \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User tlm_util.o \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt tlm_hardlink.o
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntSRCS= $(NDMP_OBJ:%.o=$(NDMP_DIR)/%.c) $(TLM_OBJ:%.o=$(TLM_DIR)/%.c)
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserSVCMETHOD = svc-ndmp
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(ROOTSVCMETHOD) := FILEMODE = 0555
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserMANIFEST = ndmp.xml
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserROOTMANIFESTDIR= $(ROOTSVCSYSTEM)
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User$(ROOTMANIFEST) := FILEMODE = 444
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserROOTNDMPDDIR= $(ROOTLIB)/ndmp
d3ddafd7469d1f3430ccd1b0fe0d13ccbbaf5debTinderbox UserROOTNDMPDFILE = $(PROG:%=$(ROOTNDMPDDIR)/%)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserFILEMODE = 0444
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User$(ROOTNDMPDFILE):= FILEMODE = 0555
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
6d45011a65dfc43f476ca15c3fd9ee5227eb968fTinderbox User$(ROOTNDMPDDIR):
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(INS.dir)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(ROOTNDMPDDIR)/%: %
6d45011a65dfc43f476ca15c3fd9ee5227eb968fTinderbox User $(INS.file)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews.KEEP_STATE:
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userall: $(PROG)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrewsinstall: all $(ROOTNDMPDDIR) $(ROOTNDMPDFILE) $(ROOTSVCMETHOD) $(ROOTMANIFEST)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Usercheck: $(CHKMANIFEST)
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userclobber:
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(PROG) : $(OBJS)
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User $(POST_PROCESS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User$(NDMP_DIR)/%.o : $(NDMP_DIR)/%.c
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User $(COMPILE.c) -o $@ $<
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User$(TLM_DIR)/%.o : $(TLM_DIR)/%.c
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User $(COMPILE.c) -o $@ $<
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlint: lint_SRCS
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsclean: rpcclean
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rm -f $(NDMP_DIR)/*.o $(TLM_DIR)/*.o
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userinclude $(SRC)/cmd/Makefile.targ
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User