Česky
Kamil Dudka

Non-Uniform CA Designer (C++, GAlib, Boost)

File detail

Name:DownloadMakefile [Download]
Location: nucad
Size:2.0 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
LZMA?=lzma
 
GALIB_DIR=galib247
GALIB_TGZ=$(GALIB_DIR).tgz
GALIB_URL="http://lancet.mit.edu/ga/dist/$(GALIB_TGZ)"
GALIB_LIB=$(GALIB_DIR)/ga/libga.a
 
GQCA_GALIB_BUNDLE=nucad-galib-1.0pre1
GQCA_GALIB_BUNDLE_TARBALL=$(GQCA_GALIB_BUNDLE).tar.lzma
GQCA_GALIB_BUNDLE_CONTENT=COPYING data doc $(GALIB_DIR) gen.sh incomplete \
						  Makefile log presentation.pdf README src test.sh
 
.PHONY: all build build_dir clean distclean doc galib  \
	$(GQCA_GALIB_BUNDLE_TARBALL) release
 
build: build_dir
	$(MAKE) all -C build
	ln -sfT build/check ./check
	ln -sfT build/nucad ./nucad
 
build_dir: $(GALIB_LIB)
	test -d build || mkdir build
	cd build && cmake -D GALIB_DIR=../$(GALIB_DIR) ../src
 
doc:
	$(MAKE) -C doc
 
all: build doc
 
$(GALIB_LIB): galib
galib: $(GALIB_DIR)
	$(MAKE) lib -C $(GALIB_DIR)
 
$(GALIB_DIR):
	test -f $(GALIB_TGZ) || $(WGET) $(GALIB_URL)
	$(TAR) xzvf $(GALIB_TGZ)
 
clean:
	rm -rfv build
 
distclean: clean
	$(MAKE) clean -C doc
	rm -rfv $(GALIB_DIR)
	rm -rfv $(GQCA_GALIB_BUNDLE) $(GQCA_GALIB_BUNDLE_TARBALL)
 
$(GQCA_GALIB_BUNDLE_TARBALL): distclean
	$(MAKE) $(GALIB_DIR)
	mkdir $(GQCA_GALIB_BUNDLE)
	cp -vR $(GQCA_GALIB_BUNDLE_CONTENT) $(GQCA_GALIB_BUNDLE)
	$(TAR) c $(GQCA_GALIB_BUNDLE) | $(LZMA) -c > $@
 
release: distclean
	$(MAKE) all
	$(MAKE) $(GQCA_GALIB_BUNDLE_TARBALL)