snapraid/Makefile.am

199 lines
5.6 KiB
Text
Raw Normal View History

2011-03-01 22:21:30 +01:00
bin_PROGRAMS = snapraid
2011-03-12 23:21:32 +01:00
check_PROGRAMS = mktest
2011-03-01 22:21:30 +01:00
snapraid_SOURCES = \
snapraid.c \
2011-03-06 22:52:50 +01:00
tommy.c \
util.c \
elem.c \
state.c \
scan.c \
sync.c \
check.c \
parity.c \
handle.c \
fnmatch.c
2011-03-01 22:21:30 +01:00
noinst_HEADERS = \
portable.h \
2011-03-06 22:52:50 +01:00
util.h \
elem.h \
state.h \
parity.h \
handle.h \
2011-03-01 22:21:30 +01:00
md5.h \
tommyarray.h \
tommychain.h \
tommyhash.h \
tommyhashdyn.h \
tommylist.h \
tommytypes.h \
tommyarray.c \
tommyhash.c \
tommyhashdyn.c \
tommylist.c \
fnmatch.h
2011-03-01 22:21:30 +01:00
2011-03-12 23:21:32 +01:00
mktest_SOURCES = \
mktest.c
2011-03-01 22:21:30 +01:00
EXTRA_DIST = \
autogen.sh \
noautomake.sh \
2011-03-17 10:23:47 +01:00
README AUTHORS HISTORY INSTALL COPYING TODO \
2011-03-22 23:21:19 +01:00
snapraid.d snapraid.1 snapraid.txt \
2011-03-01 22:21:30 +01:00
test.conf \
snapraid.conf.example \
2011-03-01 22:21:30 +01:00
acinclude.m4
man_MANS = snapraid.1
2011-03-01 22:21:30 +01:00
clean-local:
2011-03-22 23:21:19 +01:00
rm -f valgrind.log callgrind.log cachegrind.log
2011-03-01 22:21:30 +01:00
rm -rf test
2011-03-06 22:52:50 +01:00
maintainer-clean-local:
2011-03-22 23:21:19 +01:00
rm -f snapraid.1 snapraid.txt
2011-03-06 22:52:50 +01:00
# Automatic testing
2011-03-01 22:21:30 +01:00
check-local:
rm -rf test
mkdir test
mkdir test/disk1
mkdir test/disk2
mkdir test/disk3
echo --- As empty, sync and check
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf sync
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
2011-03-12 23:21:32 +01:00
echo --- Create some files, sync and check
$(TESTENV) ./mktest$(EXEEXT) generate 1 3 1000 4000
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf sync
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
2011-03-12 23:21:32 +01:00
echo --- Create some more files, sync and check
$(TESTENV) ./mktest$(EXEEXT) generate 2 3 1000 4000
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf sync
2011-03-22 23:21:19 +01:00
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
echo --- Delete some files and create some new, sync and check
rm test/disk1/1*
rm test/disk2/2*
rm test/disk3/3*
2011-03-22 23:21:19 +01:00
$(TESTENV) ./mktest$(EXEEXT) generate 3 3 100 4000
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf sync
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
echo --- Move some files, sync and check
mv test/disk1/7* test/disk1/_a/
mv test/disk2/7* test/disk2/_a/
mv test/disk3/7* test/disk3/_a/
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf sync
2011-03-22 23:21:19 +01:00
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
echo --- Delete some files and create some new, sync and check in multiple steps
rm test/disk1/4*
rm test/disk2/5*
rm test/disk3/6*
$(TESTENV) ./mktest$(EXEEXT) generate 4 3 100 4000
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf -t 7 sync
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf -t 11 sync
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf sync
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
2011-03-12 23:21:32 +01:00
echo --- Delete some files, fix and check
2011-03-22 23:21:19 +01:00
rm test/disk1/1*
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf fix 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
echo --- Delete some dirs, fix and check
rm -r test/disk2/_a
rm -r test/disk2/_b
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf fix 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
echo --- Delete a whole disk, fix and check
rm -r test/disk3
mkdir test/disk3
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf fix 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
echo --- Sync after all the fixes with an empty drive
$(TESTENV) ./snapraid$(EXEEXT) -v -E -c $(srcdir)/test.conf sync
2011-03-12 23:21:32 +01:00
echo --- Delete the parity, fix and check
2011-03-06 22:52:50 +01:00
rm test/parity
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf fix 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
2011-03-12 23:21:32 +01:00
echo --- Corrupt the parity, fix and check
$(TESTENV) ./mktest$(EXEEXT) damage 1 10 10000 test/parity
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf fix 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
2011-03-12 23:21:32 +01:00
echo --- Corrupt some files, fix and check
$(TESTENV) ./mktest$(EXEEXT) damage 1 1 500 test/disk2/b*
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf fix 2>/dev/null
$(TESTENV) ./snapraid$(EXEEXT) -c $(srcdir)/test.conf check
echo --- Sync after all the fixes
$(TESTENV) ./snapraid$(EXEEXT) -v -c $(srcdir)/test.conf sync
2011-03-01 22:21:30 +01:00
echo Success!
2011-03-22 23:21:19 +01:00
# Manual testing
CHECK = ./snapraid -v -c test.conf sync
2011-03-01 22:21:30 +01:00
valgrind:
valgrind \
--tool=memcheck \
--track-origins=yes \
--read-var-info=yes \
--leak-check=full \
-v $(CHECK) \
2> valgrind.log
tail valgrind.log
callgrind:
valgrind \
--tool=callgrind \
--dump-instr=yes \
--trace-jump=yes \
-v $(CHECK) \
2> callgrind.log
tail callgrind.log
cachegrind:
valgrind \
--tool=cachegrind \
-v $(CHECK) \
2> cachegrind.log
tail cachegrind.log
2011-03-06 22:52:50 +01:00
# Rules for documentation
2011-03-23 20:58:03 +01:00
snapraid.1 : snapraid.d
2011-03-06 22:52:50 +01:00
advd2 man < $(srcdir)/$< > $@
2011-03-23 20:58:03 +01:00
snapraid.txt : snapraid.d
2011-03-06 22:52:50 +01:00
advd2 txt < $(srcdir)/$< | todos > $@
2011-03-23 20:58:03 +01:00
snapraid.html : snapraid.d
2011-03-06 22:52:50 +01:00
advd2 html < $(srcdir)/$< > $@
# Windows distribution
DISTWIN = \
snapraid.txt \
snapraid.exe \
snapraid.conf.example
2011-03-06 22:52:50 +01:00
distwindows: $(DISTWIN)
rm -f $(PACKAGE)-$(VERSION)-windows-x86.zip
mkdir tmp
cp $(DISTWIN) tmp
2011-03-22 23:21:19 +01:00
cp README tmp/readme.txt
cp AUTHORS tmp/authors.txt
cp HISTORY tmp/history.txt
cp COPYING tmp/copying.txt
cp TODO tmp/todo.txt
2011-03-06 22:52:50 +01:00
cd tmp && zip -r ../$(PACKAGE)-$(VERSION)-windows-x86.zip *
rm -r tmp