#
# Makefile - backup tool of NILFS partitions
#
# Copyright (C) 2006 Nippon Telegraph and Telephone Corporation.
#
# This file is part of NILFS.
#
# NILFS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# NILFS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NILFS; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
# Makefile,v 1.2 2006/03/20 08:30:53 ryusuke Exp
#
# Written by Ryusuke Konishi <ryusuke@osrg.net>

BINDIR  = /sbin
SHAREDIR= /usr/share

SCRIPTS = copynilfs
FILTERS = sketch landmark
FILTER_SUBDIR = nilfsprogs/copynilfs/filter.d
TARGETS = $(FILTERS) $(SCRIPTS)

SUFFIXES += .sh
%: %.sh
	cat $< >$@
	chmod a+x $@

all: $(TARGETS)

clean:
	rm -f $(TARGETS) $(OBJS) *~

install: all
	install -d $(BINDIR)
	install -m 755 $(SCRIPTS) $(BINDIR)
	install -d $(SHAREDIR)/$(FILTER_SUBDIR)
	install -m 755 $(FILTERS) $(SHAREDIR)/$(FILTER_SUBDIR)

uninstall:
	rm -f ${SCRIPTS:%=$(BINDIR)/%}
	rm -f ${FILTERS:%=$(SHAREDIR)/$(FILTER_SUBDIR)/%}
	-cd $(SHAREDIR); rmdir -p $(FILTER_SUBDIR)

reinstall: uninstall install
