| 
									
										
										
										
											2017-05-07 23:07:57 +02:00
										 |  |  | #common make targets shared over multiple makefiles | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-09 00:07:22 +02:00
										 |  |  | ifndef INSTALL_CMD | 
					
						
							|  |  |  | $(error your makefile must define INSTALL_CMD) | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-07 23:07:57 +02:00
										 |  |  | bins: $(USEFUL_DEMOS) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | all_test: test tv_gen $(DEMOS) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #build the doxy files (requires Doxygen, tetex and patience) | 
					
						
							|  |  |  | doxygen: | 
					
						
							|  |  |  | 	$(MAKE) -C doc/ doxygen V=$(V) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | doxy: | 
					
						
							|  |  |  | 	$(MAKE) -C doc/ doxy V=$(V) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | docs: | 
					
						
							|  |  |  | 	$(MAKE) -C doc/ crypt.pdf V=$(V) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-09 00:07:22 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | install_all: install install_bins install_docs install_test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .common_install: $(LIBNAME) | 
					
						
							|  |  |  | 	install -d $(INCPATH) | 
					
						
							|  |  |  | 	install -d $(LIBPATH) | 
					
						
							|  |  |  | 	$(INSTALL_CMD) -m 644 $(LIBNAME) $(LIBPATH)/$(LIBNAME) | 
					
						
							|  |  |  | 	install -m 644 $(HEADERS) $(INCPATH) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .common_install_bins: $(USEFUL_DEMOS) | 
					
						
							|  |  |  | 	install -d $(BINPATH) | 
					
						
							|  |  |  | 	$(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(BINPATH) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .common_install_test: $(LIBTEST) | 
					
						
							|  |  |  | 	install -d $(LIBPATH) | 
					
						
							|  |  |  | 	install -d $(INCPATH) | 
					
						
							|  |  |  | 	install -m 644 testprof/tomcrypt_test.h $(INCPATH) | 
					
						
							|  |  |  | 	$(INSTALL_CMD) -m 644 $(LIBTEST) $(LIBPATH) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install_docs: docs | 
					
						
							|  |  |  | 	install -d $(DATAPATH) | 
					
						
							|  |  |  | 	install -m 644 doc/crypt.pdf $(DATAPATH) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-07 23:07:57 +02:00
										 |  |  | install_hooks: | 
					
						
							|  |  |  | 	for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #This rule cleans the source tree of all compiled code, not including the pdf | 
					
						
							|  |  |  | #documentation. | 
					
						
							|  |  |  | clean: | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.o" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.lo"  | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.a" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.la"  | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.obj" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.lib" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.exe" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.dll" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.so" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.gcov" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.gcda" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.gcno" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.il" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.dyn" | xargs` | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.dpi" | xargs` | 
					
						
							|  |  |  | 	rm -rf `find . -type d -name "*.libs" | xargs` | 
					
						
							|  |  |  | 	rm -f crypt.aux  crypt.dvi  crypt.idx  crypt.ilg  crypt.ind  crypt.log crypt.toc | 
					
						
							|  |  |  | 	rm -f $(TIMING) $(TEST) $(DEMOS) | 
					
						
							|  |  |  | 	rm -rf doc/doxygen | 
					
						
							|  |  |  | 	rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` | 
					
						
							|  |  |  | 	rm -f *.txt | 
					
						
							|  |  |  | 	rm -f *.pc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | zipup: docs | 
					
						
							|  |  |  | 	@git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) | 
					
						
							|  |  |  | 	@perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 ) | 
					
						
							|  |  |  | 	rm -rf libtomcrypt-$(VERSION) libtomcrypt-$(VERSION).* | 
					
						
							|  |  |  | 	# files/dirs excluded from "git archive" are defined in .gitattributes | 
					
						
							|  |  |  | 	git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x | 
					
						
							|  |  |  | 	mkdir -p libtomcrypt-$(VERSION)/doc | 
					
						
							|  |  |  | 	cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf | 
					
						
							|  |  |  | 	tar -cJf libtomcrypt-$(VERSION).tar.xz libtomcrypt-$(VERSION) | 
					
						
							|  |  |  | 	zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) | 
					
						
							|  |  |  | 	rm -rf libtomcrypt-$(VERSION) | 
					
						
							|  |  |  | 	gpg -b -a libtomcrypt-$(VERSION).tar.xz | 
					
						
							|  |  |  | 	gpg -b -a libtomcrypt-$(VERSION).zip | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | codecheck: | 
					
						
							|  |  |  | 	perl helper.pl -a | 
					
						
							|  |  |  | 	perlcritic *.pl |