1SUBDIRS = src tests man tests/testfiles
2
3# These prefixes are for compiling on FC15
4CROSS32_PREFIX = i686-w64-mingw32
5CROSS64_PREFIX = x86_64-w64-mingw32
6
7# on Mac, you may want this instead:
8# CROSS_PREFIX = i386-mingw32
9
10EXTRA_DIST = FILEFORMAT config.guess config.sub  m4/ax_pthread.m4 CONFIGURE_FC.sh
11
12nice:
13	rm -f *~ man/*~ src/*~ doc/*~
14
15preflight:
16	grep RBF */*.{c,cpp,h,1} doc/* AUTHORS README NEWS TODO ChangeLog
17
18todo:
19	@grep TODO *.c *.h ${man_MANS} AUTHORS README NEWS ChangeLog
20	@echo
21	@echo From TODO file:
22	@cat TODO
23
24win32:
25	make distclean
26	./configure --host=$(CROSS32_PREFIX)
27	make
28	/bin/rm -f /tmp/strings.txt
29	strings src/md5deep.exe > /tmp/strings.txt
30	if grep pthreadGC2.dll /tmp/strings.txt ; then echo not statically linked ; exit 1; fi
31
32win64:
33	make distclean
34	./configure --host=$(CROSS64_PREFIX)
35	make
36	/bin/rm -f /tmp/strings.txt
37	strings src/md5deep.exe > /tmp/strings.txt
38	if grep pthreadGC2.dll /tmp/strings.txt ; then echo not statically linked ; exit 1; fi
39	mv src/md5deep.exe       src/md5deep64.exe
40	mv src/sha1deep.exe      src/sha1deep64.exe
41	mv src/sha256deep.exe    src/sha256deep64.exe
42	mv src/tigerdeep.exe     src/tigerdeep64.exe
43	mv src/whirlpooldeep.exe src/whirlpooldeep64.exe
44	mv src/hashdeep.exe     src/hashdeep64.exe
45
46strip32:
47	$(CROSS32_PREFIX)-strip src/*.exe src/*.exe
48strip64:
49	$(CROSS64_PREFIX)-strip src/*64.exe
50
51windist:
52	@echo
53	@echo Making win32
54	@echo
55	rm -rf $(distdir).zip $(distdir) src/*.exe
56	mkdir $(distdir)
57	make win32
58	make strip32
59	cp src/*.exe $(distdir)
60	@echo ====================================
61	@echo
62	@echo Making win32
63	make win64
64	make strip64
65	make man/hashdeep.txt man/md5deep.txt
66	cp src/*.exe $(distdir)
67	@echo ====================================
68	@echo
69	@echo Creating ZIP archive
70	@echo
71	zip -r9 $(distdir).zip $(distdir)
72	@echo Adding text files to $(distdir).zip
73	cp NEWS			$(distdir)/CHANGES.txt
74	cp COPYING		$(distdir)/COPYING.txt
75	cp FILEFORMAT		$(distdir)/FILEFORMAT.txt
76	cp man/md5deep.txt	$(distdir)/MD5DEEP.txt
77	cp man/hashdeep.txt	$(distdir)/HASHDEEP.txt
78	rm man/md5deep.txt man/hashdeep.txt
79	zip --to-crlf $(distdir).zip $(distdir)/*.txt
80	rm -rf $(distdir) $(WINDOWSDOCS) MD5DEEP.1 HASHDEEP.1
81	@echo "*************************"
82	@echo "*** THE WORLD IS MADE ***"
83	@echo ""
84	ls -l $(distdir).*
85	@echo ""
86	@unzip -l $(distdir).zip
87
88wintest:
89	@echo Will create md5deep-wintest.zip, a zip file that
90	@echo provides for full testing on Microsoft Windows with Cygwin installed.
91	make windist
92	zip md5deep-wintest.zip -9 $(distdir).zip tests/* tests/*.zip tests/*.sh tests/testfiles/ tests/testfiles/*txt tests/testfiles/*/*txt tests/testfiles/*/*/*txt
93
94world:
95	@echo meta-build system.
96	@echo Making both Linux and Windows distributions
97	make distclean
98	./configure CFLAGS="-Wall -W -g -ggdb -O0"
99	make dist
100	make windist
101
102CLEANFILES = man/md5deep.txt man/hashdeep.txt
103SUFFIXES = .txt .1
104.1.txt:
105	man $< > $@
106