Česky
Kamil Dudka

Digital Watermarking (C++, Qt3, gnulib)

File detail

Name:DownloadMakefile [Download]
Location: kry2 > kry2-1.0pre1
Size:2.4 KB
Last modification:2009-07-12 01:46

Source code

# Copyright (C) 2009 Kamil Dudka <xdudka00@stud.fit.vutbr.cz>
#
# This file is part of nucad (Non-Uniform CA Designer).
#
# nucad 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 3 of the License, or
# any later version.
#
# nucad 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 nucad.  If not, see <http://www.gnu.org/licenses/>.
 
WGET?=wget
TAR?=tar
UNZIP?=unzip
 
BUILD_DIR=build
 
KRY2_BUNDLE=kry2-1.0pre1
KRY2_BUNDLE_TARBALL=$(KRY2_BUNDLE).tar.bz2
KRY2_BUNDLE_CONTENT=COPYING check.sh doc gl_src kry2.pdf Makefile README src \
					$(HAM_DIR)
 
HAM_DIR=hamming-0.3
HAM_ZIP=$(HAM_DIR).zip
HAM_URL="http://michael.dipperstein.com/hamming/hamming-0.3.zip"
HAM_OBJ=$(HAM_DIR)/hamming.o
 
GL_SRC_DIR=gl_src
GL_BUILD_DIR=gl_build
GL_LIB=$(GL_BUILD_DIR)/gllib/libgnu.a
 
.PHONY: all build build_dir clean check distclean doc \
	$(KRY2_BUNDLE_TARBALL) release
 
build: build_dir
	$(MAKE) all -C $(BUILD_DIR)
	ln -sfT build/kry2 ./kry2
 
build_dir: $(HAM_OBJ) $(GL_LIB) $(GL_SRC_DIR)/gllib
	test -d $(BUILD_DIR) || mkdir $(BUILD_DIR)
	cd $(BUILD_DIR) && cmake \
		-D HAM_DIR=../$(HAM_DIR) \
		-D GL_DIR=../$(GL_BUILD_DIR)/gllib \
		-D GL_INC=../$(GL_SRC_DIR)/gllib \
		../src
 
doc:
	$(MAKE) -C doc
 
all: build check doc
 
$(HAM_OBJ): $(HAM_DIR)
	$(MAKE) hamming.o -C $(HAM_DIR)
 
$(HAM_DIR):
	test -f $(HAM_ZIP) || $(WGET) $(HAM_URL)
	test -d $(HAM_DIR) || mkdir $(HAM_DIR)
	cd $(HAM_DIR) && $(UNZIP) ../$(HAM_ZIP)
 
$(GL_LIB): $(GL_BUILD_DIR)
	$(MAKE) -C $(GL_BUILD_DIR)
 
$(GL_BUILD_DIR):
	test -d $(GL_BUILD_DIR) || mkdir $(GL_BUILD_DIR)
	cd $(GL_BUILD_DIR) && ../$(GL_SRC_DIR)/configure
 
check: build
	$(MAKE) check -C $(GL_BUILD_DIR)
	$(MAKE) test -C $(BUILD_DIR)
 
clean:
	rm -rfv $(BUILD_DIR)
 
distclean: clean
	$(MAKE) clean -C doc
	rm -rfv $(HAM_DIR) $(GL_BUILD_DIR)
	rm -rfv $(KRY2_BUNDLE) $(KRY2_BUNDLE_TARBALL) ./kry2
 
$(KRY2_BUNDLE_TARBALL): distclean
	$(MAKE) $(HAM_DIR)
	mkdir $(KRY2_BUNDLE)
	cp -vR $(KRY2_BUNDLE_CONTENT) $(KRY2_BUNDLE)
	$(TAR) cfj $@ $(KRY2_BUNDLE)
 
release: distclean
	$(MAKE) all
	$(MAKE) clean -C doc
	$(MAKE) $(KRY2_BUNDLE_TARBALL)