Skip to content

Instantly share code, notes, and snippets.

@danielsdeleo
Last active August 29, 2015 13:56
Show Gist options
  • Save danielsdeleo/96f0d8bba1a1a385f30a to your computer and use it in GitHub Desktop.
Save danielsdeleo/96f0d8bba1a1a385f30a to your computer and use it in GitHub Desktop.
Building Gecode and dep_selector on windows notes
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.
V = 1
Q1 = $(V:1=)
Q = $(Q1:0=@)
n=$(NULLCMD)
ECHO1 = $(V:1=@$n)
ECHO = $(ECHO1:0=@echo)
#### Start of system configuration section. ####
srcdir = .
topdir = /C/opscode/chef/embedded/include/ruby-1.9.1
hdrdir = /C/opscode/chef/embedded/include/ruby-1.9.1
arch_hdrdir = C:/opscode/chef/embedded/include/ruby-1.9.1/$(arch)
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
DESTDIR = C:
prefix = $(DESTDIR)/opscode/chef/embedded
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
exec_prefix = $(prefix)
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
sitehdrdir = $(rubyhdrdir)/site_ruby
rubyhdrdir = $(includedir)/$(RUBY_BASE_NAME)-$(ruby_version)
vendordir = $(rubylibprefix)/vendor_ruby
sitedir = $(rubylibprefix)/site_ruby
ridir = $(datarootdir)/$(RI_BASE_NAME)
mandir = $(datarootdir)/man
localedir = $(datarootdir)/locale
libdir = $(exec_prefix)/lib
psdir = $(docdir)
pdfdir = $(docdir)
dvidir = $(docdir)
htmldir = $(docdir)
infodir = $(datarootdir)/info
docdir = $(datarootdir)/doc/$(PACKAGE)
oldincludedir = $(DESTDIR)/usr/include
includedir = $(prefix)/include
localstatedir = $(prefix)/var
sharedstatedir = $(prefix)/com
sysconfdir = $(prefix)/etc
datadir = $(datarootdir)
datarootdir = $(prefix)/share
libexecdir = $(exec_prefix)/libexec
sbindir = $(exec_prefix)/sbin
bindir = $(exec_prefix)/bin
rubylibdir = $(rubylibprefix)/$(ruby_version)
archdir = $(rubylibdir)/$(arch)
sitelibdir = $(DESTDIR)/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-0.0.8/ext/dep_gecode/.gem.20140221-2420-q2fssu
sitearchdir = $(DESTDIR)/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-0.0.8/ext/dep_gecode/.gem.20140221-2420-q2fssu
vendorlibdir = $(vendordir)/$(ruby_version)
vendorarchdir = $(vendorlibdir)/$(sitearch)
NULLCMD = :
CC = gcc
CXX = g++
LIBRUBY = lib$(RUBY_SO_NAME).dll.a
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
empty =
OUTFLAG = -o $(empty)
COUTFLAG = -o $(empty)
RUBY_EXTCONF_H =
cflags = $(optflags) $(debugflags) $(warnflags)
optflags = -O3 -fno-omit-frame-pointer
debugflags = -g
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
CFLAGS = $(cflags) $(ARCH_FLAG) -v -mthreads
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
DEFS =
CPPFLAGS = -Ic:/opscode/chef/embedded/local/include/ -DFD_SETSIZE=2048 $(DEFS) $(cppflags)
CXXFLAGS = $(CFLAGS) $(cxxflags) -v -mthreads
ldflags = -L. -Lc:/opscode/chef/embedded/local/lib/
dldflags = -Wl,--enable-auto-image-base,--enable-auto-import $(DEFFILE)
ARCH_FLAG =
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
LDSHARED = $(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
LDSHAREDXX = $(CXX) -v -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
AR = ar
EXEEXT = .exe
RUBY_BASE_NAME = ruby
RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = msvcrt-ruby191
arch = i386-mingw32
sitearch = i386-msvcrt
ruby_version = 1.9.1
ruby = C:/opscode/chef/embedded/bin/ruby
RUBY = $(ruby)
RM = rm -f
RM_RF = $(RUBY) -run -e rm -- -rf
RMDIRS = rmdir --ignore-fail-on-non-empty -p
MAKEDIRS = /usr/bin/mkdir -p
INSTALL = /usr/bin/install -c
INSTALL_PROG = $(INSTALL) -m 0755
INSTALL_DATA = $(INSTALL) -m 644
COPY = cp
TOUCH = exit >
#### End of system configuration section. ####
preload =
libpath = . $(libdir) c:/opscode/chef/embedded/local/lib/
LIBPATH = -L. -L$(libdir) -Lc:/opscode/chef/embedded/local/lib/
DEFFILE = $(TARGET)-$(arch).def
CLEANFILES = mkmf.log $(DEFFILE)
DISTCLEANFILES =
DISTCLEANDIRS =
extout =
extout_prefix =
target_prefix =
LOCAL_LIBS =
LIBS = $(LIBRUBYARG_SHARED) -lgecodekernel -lgecodeminimodel -lgecodesupport -lgecodeint -lgecodesearch -lshell32 -lws2_32 -limagehlp -lshlwapi -mthreads -lstdc++
SRCS = dep_selector_swig_wrap.cxx dep_selector_to_gecode.cpp dep_selector_to_gecode_interface.cpp
OBJS = dep_selector_swig_wrap.o dep_selector_to_gecode.o dep_selector_to_gecode_interface.o
TARGET = dep_gecode
TARGET_NAME = dep_gecode
TARGET_ENTRY = Init_$(TARGET_NAME)
DLLIB = $(TARGET).so
EXTSTATIC =
STATIC_LIB =
BINDIR = $(bindir)
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
TARGET_SO = $(DLLIB)
CLEANLIBS = $(TARGET).so
CLEANOBJS = *.o *.bak
all: $(DLLIB)
static: $(STATIC_LIB)
.PHONY: all install static install-so install-rb
.PHONY: clean clean-so clean-rb
clean-static::
clean-rb-default::
clean-rb::
clean-so::
clean: clean-so clean-static clean-rb-default clean-rb
-$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
distclean-rb-default::
distclean-rb::
distclean-so::
distclean: clean distclean-so distclean-rb-default distclean-rb
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
@-$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
realclean: distclean
install: install-so install-rb
install-so: $(RUBYARCHDIR)/$(DLLIB)
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
-$(Q)$(MAKEDIRS) $(@D)
$(INSTALL_PROG) $(DLLIB) $(@D)
clean-static::
-$(Q)$(RM) $(STATIC_LIB)
install-rb: pre-install-rb install-rb-default
install-rb-default: pre-install-rb-default
pre-install-rb: Makefile
pre-install-rb-default: Makefile
pre-install-rb-default: ./.RUBYLIBDIR.time
install-rb-default: $(RUBYLIBDIR)/dep_selector_to_gecode.rb $(RUBYLIBDIR)
$(RUBYLIBDIR)/dep_selector_to_gecode.rb: $(srcdir)/lib/dep_selector_to_gecode.rb
$(Q) $(INSTALL_DATA) $(srcdir)/lib/dep_selector_to_gecode.rb $(@D)
pre-install-rb-default:
$(ECHO) installing default dep_gecode libraries
./.RUBYARCHDIR.time:
$(Q) $(MAKEDIRS) $(RUBYARCHDIR)
$(Q) $(TOUCH) $@
./.RUBYLIBDIR.time:
$(Q) $(MAKEDIRS) $(RUBYLIBDIR)
$(Q) $(TOUCH) $@
site-install: site-install-so site-install-rb
site-install-so: install-so
site-install-rb: install-rb
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o
.cc.o:
$(ECHO) compiling $(<)
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
.mm.o:
$(ECHO) compiling $(<)
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
.cxx.o:
$(ECHO) compiling $(<)
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
.cpp.o:
$(ECHO) compiling $(<)
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
.c.o:
$(ECHO) compiling $(<)
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
.m.o:
$(ECHO) compiling $(<)
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
$(DLLIB): $(DEFFILE) $(OBJS) Makefile
$(ECHO) linking shared-object $(DLLIB)
-$(Q)$(RM) $(@)
$(Q) $(LDSHAREDXX) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
$(DEFFILE):
$(ECHO) generating $(@)
$(Q) $(RUBY) -e "puts 'EXPORTS', '$(TARGET_ENTRY)'" > $@
$(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h

Gecode on Windows Notes

Precompiled MSIs

These are a no-go. They're compiled with visual studio, but we need libraries compiled with gcc. This means we have to go it alone.

Building from Source.

I'm using the mingw gcc that's in DevKit. You have to add it to the path. (Also, I'm using bash from the git windows package)

export PATH=/c/DevKit/mingw/bin:$PATH

The configure script doesn't work out of the box. I find this ML post: http://www.gecode.org/pipermail/users/2013-January/003763.html

so, configure with:

 ./configure \
    --disable-doc-dot \
    --disable-doc-search \
    --disable-doc-tagfile \
    --disable-doc-chm \
    --disable-doc-docset \
    --disable-qt \
    --disable-examples \
    --with-host-os=windows \
    CC=gcc  CXX=g++

Long version for easy copypasta:

./configure --disable-doc-dot --disable-doc-search --disable-doc-tagfile --disable-doc-chm --disable-doc-docset --disable-qt --disable-examples --with-host-os=windows CC=gcc CXX=g++

Then make and make install. The first make can be parallellized for your sanity (make -j5 on my 4-core VM)

For reasons that I don't really understand (something about my environment, PATH, conemu, etc.) this installed gecode into (windows bash path syntax):

/c/opscode/chef/embedded/local

So we can install dep_selector with:

gem install dep_selector -- --with-opt-lib=/c/opscode/chef/embedded/local/lib/ --with-opt-include=/c/opscode//chef/embedded/local/include/

Except that this explodes during compilation. I'm guessing it's because I built gecode 4.x, and dep_selector probably needs 3.x, so now we're gonna try with gecode 3.7.3. I'm a little worried by the content of the ML post I linked that some windows build support fixes are not available in this version, but we're about to find out...

So 3.7.3 builds. Then we try to install dep_selector again, and we get to here: https://gist.github.com/danielsdeleo/a57ec2a2b257c6f525d5

Next Steps:

  • We can try upgrading to a newer mingw package. I have version 4.5.2, which is included with a very old chef omnibus package. So we can see if using a newer omnibus package gets us a newer mingw that magically fixes things. NOPE newer omnibus doesn't have a newer mingw.
  • We can try modifying dep_selector so that it works with gecode 4.x. gecode seems to support windows much better now, so 4.x may have some fixes that make things work "magically" for us. We probably need to do this anyway if we want to keep using gecode in the future.
# -*-Makefile-*-
#
# Main authors:
# Christian Schulte <schulte@gecode.org>
# Guido Tack <tack@gecode.org>
#
# Copyright:
# Christian Schulte, 2005
# Guido Tack, 2005
#
# Last modified:
# $Date: 2012-03-21 16:25:08 +1100 (Wed, 21 Mar 2012) $ by $Author: tack $
# $Revision: 12605 $
#
# This file is part of Gecode, the generic constraint
# development environment:
# http://www.gecode.org
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
#
# General Settings
#
export prefix =
export exec_prefix = ${prefix}
export bindir = ${exec_prefix}/bin
export libdir = ${exec_prefix}/lib
export sharedlibdir = ${exec_prefix}/lib
export includedir = ${prefix}/include
export srcdir = .
export datarootdir = ${prefix}/share
export datadir = ${datarootdir}
export docdir= ${datarootdir}/doc/gecode
export top_srcdir = .
export top_builddir = .
# Install to different root directory
DESTDIR=
export subdirs =
export VERSION = 3.7.3
export CXX = g++
export CC = gcc
export MOC =
ifeq "$(top_srcdir)" "$(top_builddir)"
CPPFLAGS=-I$(top_srcdir)
else
CPPFLAGS=-I$(top_builddir) -I$(top_srcdir)
endif
export CPPFLAGS
export CXXFLAGS = $(CPPFLAGS) -mthreads -ffast-math -fno-strict-aliasing -O3 -ggdb -pipe -Wall -Wextra -DNDEBUG $(CXXUSR)
export CFLAGS = $(CPPFLAGS) -mthreads -ffast-math -fno-strict-aliasing -O3 -ggdb -pipe -Wall -Wextra -DNDEBUG $(CUSR)
export EXAMPLES_EXTRA_CXXFLAGS =
export QT_CPPFLAGS =
export LINKQT =
ifeq "no" "yes"
export LINKSTATICQT
else
export LINKSTATICQT = $(LINKQT)
endif
export BOOST_CPPFLAGS =
export BOOST_LINK =
export GLDFLAGS =
export DLLFLAGS = -shared
export DLLPATH = -L.
export RANLIB = ranlib
export TAR = tar
#
# Use suffixes to get consistent treatment of dots
#
export OBJSUFFIX = .o
export SBJSUFFIX = .s
export DLLSUFFIX = .dll
export MANIFESTSUFFIX = .dll.manifest
export RCSUFFIX = .dll.rc
export RESSUFFIX = .dll.res
export LIBSUFFIX = .dll
export PDBSUFFIX = .pdb
export EXPSUFFIX = .exp
export STATICLIBSUFFIX = .a
export EXESUFFIX = .exe
export LIBPREFIX = libgecode
export LINKPREFIX = -lgecode
export LINKSUFFIX =
export SOLINKSUFFIX =
export SOSUFFIX =
#
# Programs
#
export RMF = rm -rf
export MV = mv
export MANIFEST = @true -nologo
export FIXMANIFEST = perl $(top_srcdir)/misc/fixmanifest.perl $(DLLSUFFIX)
export RESCOMP = @true -n -i$(top_srcdir)
export RCGEN = perl $(top_srcdir)/misc/genrc.perl $(DLLSUFFIX) $(top_srcdir)
ifeq "no" "yes"
export CREATELINK = ln -fs
else
export CREATELINK = @true
endif
ifeq "no" "yes"
%.res: %.rc
$(RESCOMP) -fo $@ $<
.PRECIOUS: %.res %.rc
endif
#
# SUPPORT COMPONENTS
#
SUPPORTSRC0 = \
exception heap thread/thread thread/windows thread/pthreads
SUPPORTHDR0 = \
block-allocator cast dynamic-array \
dynamic-stack exception heap \
macros random sort static-stack \
marked-pointer int-type auto-link \
thread thread/thread thread/windows thread/pthreads thread/none timer \
dynamic-queue bitset-base bitset
SUPPORTSRC1 = $(SUPPORTSRC0:%=gecode/support/%.cpp)
SUPPORTHDR = gecode/support.hh \
$(SUPPORTHDR0:%=gecode/support/%.hpp)
SUPPORTOBJ = $(SUPPORTSRC1:%.cpp=%$(OBJSUFFIX))
SUPPORTSRC = $(SUPPORTSRC1)
export SUPPORTDLL = $(LIBPREFIX)support$(DLLSUFFIX)
export SUPPORTLIB = $(LIBPREFIX)support$(LIBSUFFIX)
ifeq "no" "yes"
export SUPPORTSONAME = \
$(LIBPREFIX)support$(SOSUFFIX)
else
export SUPPORTSONAME =
endif
export SUPPORTSTATICLIB = $(LIBPREFIX)support$(STATICLIBSUFFIX)
export LINKSUPPORT = \
$(LINKPREFIX)support$(LINKSUFFIX)
ifeq "no" "yes"
export SUPPORTRC = $(LIBPREFIX)support$(RCSUFFIX)
export SUPPORTRES = $(LIBPREFIX)support$(RESSUFFIX)
else
export SUPPORTRES =
export SUPPORTRC =
endif
SUPPORTBUILDDIRS = support support/thread
#
# KERNEL COMPONENTS
#
VARIMPHDR = \
gecode/kernel/var-type.hpp \
gecode/kernel/var-imp.hpp
VARIMP = $(VARIMPHDR)
KERNELSRC0 = \
archive core memory-manager branch region
KERNELHDR0 = \
archive array shared-array core exception \
macros memory-config memory-manager region modevent range-list \
propagator advisor view var \
branch brancher brancher-view brancher-tiebreak \
brancher-val allocators global-prop-info
KERNELSRC = $(KERNELSRC0:%=gecode/kernel/%.cpp)
KERNELHDR = \
gecode/kernel.hh gecode/kernel/wait.hh \
$(KERNELHDR0:%=gecode/kernel/%.hpp)
KERNELOBJ = $(KERNELSRC:%.cpp=%$(OBJSUFFIX))
export KERNELDLL = $(LIBPREFIX)kernel$(DLLSUFFIX)
export KERNELLIB = $(LIBPREFIX)kernel$(LIBSUFFIX)
ifeq "no" "yes"
export KERNELSONAME = \
$(LIBPREFIX)kernel$(SOSUFFIX)
else
export KERNELSONAME =
endif
export KERNELSTATICLIB = $(LIBPREFIX)kernel$(STATICLIBSUFFIX)
export LINKKERNEL = $(LINKPREFIX)kernel$(LINKSUFFIX)
ifeq "no" "yes"
export KERNELRC = $(LIBPREFIX)kernel$(RCSUFFIX)
export KERNELRES = $(LIBPREFIX)kernel$(RESSUFFIX)
else
export KERNELRES =
export KERNELRC =
endif
KERNELBUILDDIRS = kernel
EXTRA_HEADERS = gecode/support/config.hpp
#
# SEARCH COMPONENTS
#
SEARCHSRC0 = \
stop options \
parallel/engine \
dfs parallel/dfs \
bab parallel/bab \
restart parallel/restart
SEARCHHDR0 = \
statistics.hpp stop.hpp options.hpp \
support.hh worker.hh \
sequential/path.hh sequential/dfs.hh sequential/bab.hh \
sequential/restart.hh \
parallel/path.hh parallel/engine.hh \
parallel/dfs.hh parallel/bab.hh \
parallel/restart.hh \
dfs.hpp bab.hpp restart.hpp
SEARCHSRC = $(SEARCHSRC0:%=gecode/search/%.cpp)
SEARCHHDR = gecode/search.hh $(SEARCHHDR0:%=gecode/search/%)
SEARCHOBJ = $(SEARCHSRC:%.cpp=%$(OBJSUFFIX))
ifeq "yes" "yes"
export SEARCHDLL = $(LIBPREFIX)search$(DLLSUFFIX)
export SEARCHSTATICLIB = $(LIBPREFIX)search$(STATICLIBSUFFIX)
export SEARCHLIB = $(LIBPREFIX)search$(LIBSUFFIX)
export LINKSEARCH = $(LINKPREFIX)search$(LINKSUFFIX)
ifeq "no" "yes"
export SEARCHSONAME = \
$(LIBPREFIX)search$(SOSUFFIX)
else
export SEARCHSONAME =
ifeq "no" "yes"
export SEARCHRC = $(LIBPREFIX)search$(RCSUFFIX)
export SEARCHRES = $(LIBPREFIX)search$(RESSUFFIX)
else
export SEARCHRES =
export SEARCHRC =
endif
endif
else
export SEARCHDLL =
export SEARCHSTATICLIB =
export SEARCHLIB =
export LINKSEARCH =
export SEARCHRES =
export SEARCHRC =
endif
SEARCHBUILDDIRS = search search/sequential search/parallel
#
# INTEGER COMPONENTS
#
INTSRC0 = \
int-set.cpp var-imp/int.cpp var-imp/bool.cpp var/int.cpp \
var/bool.cpp array.cpp bool.cpp bool/eqv.cpp \
extensional/dfa.cpp extensional/tuple-set.cpp extensional.cpp \
dom.cpp rel.cpp precede.cpp element.cpp count.cpp \
arithmetic.cpp exec.cpp \
exec/when.cpp element/pair.cpp \
linear/int-post.cpp linear-int.cpp \
linear/bool-post.cpp linear-bool.cpp \
branch.cpp distinct.cpp sorted.cpp gcc.cpp \
channel.cpp channel/link-single.cpp channel/link-multi.cpp \
unshare.cpp sequence.cpp \
bin-packing.cpp bin-packing/propagate.cpp \
unary.cpp cumulative.cpp cumulatives.cpp \
circuit.cpp no-overlap.cpp nvalues.cpp \
member.cpp
INTHDR0 = \
limits.hpp support-values.hh support-values.hpp \
exec.hh exec/when.hpp \
arithmetic/abs.hpp arithmetic/max.hpp arithmetic/mult.hpp \
arithmetic/sqr.hpp arithmetic/sqrt.hpp arithmetic/divmod.hpp \
bool/or.hpp bool/eq.hpp bool/lq.hpp bool/eqv.hpp bool/base.hpp \
bool/clause.hpp \
precede.hh precede/single.hpp \
branch/post-val-int.hpp branch/post-val-bool.hpp \
branch/select-val.hpp \
branch/select-values.hpp branch/select-view.hpp \
count.hh count/rel.hpp \
count/int-base.hpp count/int-eq.hpp \
count/int-gq.hpp count/int-lq.hpp \
count/view-base.hpp count/view-eq.hpp \
count/view-gq.hpp count/view-lq.hpp \
view-val-graph.hh view-val-graph/graph.hpp \
view-val-graph/bi-link.hpp view-val-graph/comb-ptr-flag.hpp \
view-val-graph/edge.hpp view-val-graph/node.hpp \
view-val-graph/iter-prune-val.hpp \
distinct/graph.hpp distinct/dom-ctrl.hpp \
distinct/bnd.hpp distinct/dom.hpp \
distinct/val.hpp distinct/ter-dom.hpp \
dom/range.hpp dom/spec.hpp \
element/int.hpp element/view.hpp element/pair.hpp \
gcc/bnd.hpp gcc/dom.hpp gcc/bnd-sup.hpp gcc/dom-sup.hpp \
gcc/val.hpp gcc/view.hpp gcc/post.hpp \
linear/post.hpp \
linear/int-noview.hpp linear/int-bin.hpp linear/int-ter.hpp \
linear/int-nary.hpp linear/int-dom.hpp \
linear/bool-int.hpp linear/bool-view.hpp linear/bool-scale.hpp \
extensional/dfa.hpp extensional/layered-graph.hpp \
extensional/tuple-set.hpp extensional/base.hpp \
extensional/basic.hpp extensional/incremental.hpp \
rel/eq.hpp rel/lex.hpp rel/lq-le.hpp rel/nq.hpp \
sorted/matching.hpp sorted/narrowing.hpp \
sorted/order.hpp sorted/propagate.hpp sorted/sortsup.hpp \
int-set-1.hpp int-set-2.hpp var-imp/delta.hpp var/print.hpp var/bool.hpp \
var-imp/int.hpp var-imp/bool.hpp var/int.hpp \
view/bool.hpp view/cached.hpp view/constint.hpp view/zero.hpp view/int.hpp \
view/minus.hpp view/print.hpp view/neg-bool.hpp view/bool-test.hpp \
view/offset.hpp view/rel-test.hpp view/scale.hpp view/iter.hpp \
arithmetic.hh array.hpp array-traits.hpp bool.hh branch.hh \
distinct.hh dom.hh \
element.hh exception.hpp gcc.hh linear.hh \
propagator.hpp extensional.hh rel.hh \
sorted.hh var-imp.hpp view.hpp \
channel.hh channel/dom.hpp channel/val.hpp \
channel/base.hpp channel/link-single.hpp channel/link-multi.hpp \
sequence.hh sequence/int.hpp sequence/view.hpp \
sequence/set-op.hpp sequence/violations.hpp \
bin-packing.hh bin-packing/propagate.hpp \
task.hh task/fwd-to-bwd.hpp task/array.hpp task/sort.hpp \
task/iter.hpp task/tree.hpp task/purge.hpp task/prop.hpp \
task/man-to-opt.hpp \
unary.hh unary/task.hpp unary/task-view.hpp \
unary/tree.hpp unary/overload.hpp unary/detectable.hpp \
unary/not-first-not-last.hpp \
unary/edge-finding.hpp unary/subsumption.hpp \
unary/man-prop.hpp unary/opt-prop.hpp \
cumulative.hh cumulative/man-prop.hpp cumulative/opt-prop.hpp \
cumulative/task-view.hpp cumulative/overload.hpp \
cumulative/basic.hpp cumulative/task.hpp cumulative/edge-finding.hpp \
cumulative/tree.hpp \
cumulatives.hh cumulatives/val.hpp \
circuit.hh circuit/base.hpp circuit/val.hpp circuit/dom.hpp \
no-overlap.hh no-overlap/dim.hpp no-overlap/box.hpp \
no-overlap/base.hpp no-overlap/man.hpp no-overlap/opt.hpp \
nvalues.hh nvalues/range-event.hpp \
nvalues/sym-bit-matrix.hpp nvalues/graph.hpp \
nvalues/bool-base.hpp nvalues/bool-eq.hpp \
nvalues/bool-lq.hpp nvalues/bool-gq.hpp \
nvalues/int-base.hpp nvalues/int-eq.hpp \
nvalues/int-lq.hpp nvalues/int-gq.hpp \
val-set.hh val-set.hpp \
member.hh member/prop.hpp member/re-prop.hpp
INTSRC = $(INTSRC0:%=gecode/int/%) \
gecode/int/branch/post-view-int.cpp \
gecode/int/branch/post-view-bool.cpp
INTHDR = gecode/int.hh $(INTHDR0:%=gecode/int/%)
INTOBJ = $(INTSRC:%.cpp=%$(OBJSUFFIX))
ifeq "yes" "yes"
export INTDLL = $(LIBPREFIX)int$(DLLSUFFIX)
export INTSTATICLIB = $(LIBPREFIX)int$(STATICLIBSUFFIX)
export INTLIB = $(LIBPREFIX)int$(LIBSUFFIX)
export LINKINT = $(LINKPREFIX)int$(LINKSUFFIX)
ifeq "no" "yes"
export INTSONAME = \
$(LIBPREFIX)int$(SOSUFFIX)
else
export INTSONAME =
endif
ifeq "no" "yes"
export INTRC = $(LIBPREFIX)int$(RCSUFFIX)
export INTRES = $(LIBPREFIX)int$(RESSUFFIX)
else
export INTRES =
export INTRC =
endif
else
export INTDLL =
export INTSTATICLIB =
export INTLIB =
export LINKINT =
export INTRES =
export INTRC =
endif
INTBUILDDIRS = \
int int/var int/var-imp int/view int/extensional \
int/channel int/linear int/bool int/branch int/exec \
int/element int/sequence int/bin-packing \
int/unary int/cumulative int/cumulatives int/task
#
# SET COMPONENTS
#
SETSRC0 = \
branch.cpp cardinality.cpp convex.cpp convex/conv.cpp convex/hull.cpp \
dom.cpp rel.cpp \
rel-op.cpp rel-op-ternary.cpp rel-op-singleton.cpp \
rel-op/post-compl.cpp rel-op/post-nocompl.cpp \
rel-op/post-compl-cvv.cpp rel-op/post-nocompl-cvv.cpp \
rel-op/post-compl-vvc.cpp rel-op/post-nocompl-vvc.cpp \
rel-op/post-compl-cvc.cpp rel-op/post-nocompl-cvc.cpp \
rel-op-const-vvc.cpp rel-op-const-vcv.cpp rel-op-const-vcc.cpp \
rel-op-const-cvc.cpp rel-op-const-cvv.cpp \
int.cpp \
element.cpp sequence.cpp \
distinct.cpp distinct/atmostOne.cpp \
precede.cpp \
sequence/seq.cpp sequence/seq-u.cpp array.cpp var-imp/set.cpp \
var-imp/integerset.cpp var/set.cpp \
exec.cpp
SETHDR0 = \
limits.hpp \
view.hpp exception.hpp int.hh element.hh var-imp.hpp \
int/card.hpp \
int/match.hpp int/channel-int.hpp int/minmax.hpp int/weights.hpp \
int/channel-bool.hpp \
element/inter.hpp element/union.hpp \
element/unionConst.hpp \
element/disjoint.hpp array.hpp array-traits.hpp \
var-imp/set.hpp var-imp/integerset.hpp \
var-imp/delta.hpp var-imp/iter.hpp \
var/set.hpp var/print.hpp \
view/complement.hpp view/const.hpp view/set.hpp view/singleton.hpp \
view/cached.hpp view/print.hpp \
rel/subset.hpp rel/re-subset.hpp rel/eq.hpp rel/nq.hpp rel/re-eq.hpp \
rel/lq.hpp rel/re-lq.hpp \
rel/common.hpp rel/nosubset.hpp sequence.hh \
rel-op/union.hpp rel-op/partition.hpp rel-op/subofunion.hpp \
rel-op/inter.hpp rel-op/superofinter.hpp \
rel-op/post.hpp rel-op/common.hpp rel.hh \
distinct.hh distinct/atmostOne.hpp \
sequence/seq.hpp sequence/seq-u.hpp \
sequence/common.hpp convex/conv.hpp convex/hull.hpp convex.hh \
precede.hh precede/single.hpp \
rel-op.hh \
branch.hh branch/select-val.hpp branch/select-view.hpp \
branch/post-val.hpp
SETSRC = $(SETSRC0:%=gecode/set/%) \
gecode/set/branch/post-view.cpp
SETHDR = gecode/set.hh $(SETHDR0:%=gecode/set/%)
SETOBJ = $(SETSRC:%.cpp=%$(OBJSUFFIX))
ifeq "yes" "yes"
export SETDLL = $(LIBPREFIX)set$(DLLSUFFIX)
export SETSTATICLIB = $(LIBPREFIX)set$(STATICLIBSUFFIX)
export SETLIB = $(LIBPREFIX)set$(LIBSUFFIX)
export LINKSET = $(LINKPREFIX)set$(LINKSUFFIX)
ifeq "no" "yes"
export SETSONAME = \
$(LIBPREFIX)set$(SOSUFFIX)
else
export SETSONAME =
endif
ifeq "no" "yes"
export SETRC = $(LIBPREFIX)set$(RCSUFFIX)
export SETRES = $(LIBPREFIX)set$(RESSUFFIX)
else
export SETRES =
export SETRC =
endif
else
export SETDLL =
export SETSTATICLIB =
export SETLIB =
export LINKSET =
export SETRES =
export SETRC =
endif
SETBUILDDIRS = \
set set/convex set/distinct set/int set/rel set/rel-op \
set/element set/sequence set/var set/var-imp set/view \
set/branch
#
# MINIMODEL COMPONENTS
#
MMSRC0 = \
lin-expr.cpp lin-rel.cpp bool-expr.cpp \
set-expr.cpp set-rel.cpp \
reg.cpp arithmetic.cpp
MMHDR0 = \
lin-expr.hpp lin-rel.hpp exception.hpp matrix.hpp \
bool-expr.hpp set-expr.hpp set-rel.hpp \
optimize.hpp reg.hpp
MMSRC = $(MMSRC0:%=gecode/minimodel/%)
MMHDR = gecode/minimodel.hh $(MMHDR0:%=gecode/minimodel/%)
MMOBJ = $(MMSRC:%.cpp=%$(OBJSUFFIX))
MMSBJ = $(MMSRC:%.cpp=%$(SBJSUFFIX))
ifeq "yes" "yes"
export MMDLL = $(LIBPREFIX)minimodel$(DLLSUFFIX)
export MMSTATICLIB = $(LIBPREFIX)minimodel$(STATICLIBSUFFIX)
export MMLIB = $(LIBPREFIX)minimodel$(LIBSUFFIX)
export LINKMM = $(LINKPREFIX)minimodel$(LINKSUFFIX)
ifeq "no" "yes"
export MMSONAME = \
$(LIBPREFIX)minimodel$(SOSUFFIX)
else
export MMSONAME =
endif
ifeq "no" "yes"
export MMRC = $(LIBPREFIX)minimodel$(RCSUFFIX)
export MMRES = $(LIBPREFIX)minimodel$(RESSUFFIX)
else
export MMRES =
export MMRC =
endif
else
export MMDLL =
export MMSTATICLIB =
export MMLIB =
export LINKMM =
export MMRES =
export MMRC =
endif
MMBUILDDIRS = minimodel
#
# DRIVER COMPONENTS
#
DRIVERSRC0 = options.cpp script.cpp
DRIVERHDR0 = options.hpp script.hpp
DRIVERSRC = $(DRIVERSRC0:%=gecode/driver/%)
DRIVERHDR = gecode/driver.hh $(DRIVERHDR0:%=gecode/driver/%)
DRIVEROBJ = $(DRIVERSRC:%.cpp=%$(OBJSUFFIX))
DRIVERSBJ = $(DRIVERSRC:%.cpp=%$(SBJSUFFIX))
ifeq "yes" "yes"
export DRIVERDLL = $(LIBPREFIX)driver$(DLLSUFFIX)
export DRIVERSTATICLIB = $(LIBPREFIX)driver$(STATICLIBSUFFIX)
export DRIVERLIB = $(LIBPREFIX)driver$(LIBSUFFIX)
export LINKDRIVER = $(LINKPREFIX)driver$(LINKSUFFIX)
ifeq "no" "yes"
export DRIVERSONAME = \
$(LIBPREFIX)driver$(SOSUFFIX)
else
export DRIVERSONAME =
endif
ifeq "no" "yes"
export DRIVERRC = $(LIBPREFIX)driver$(RCSUFFIX)
export DRIVERRES = $(LIBPREFIX)driver$(RESSUFFIX)
else
export DRIVERRES =
export DRIVERRC =
endif
else
export DRIVERDLL =
export DRIVERSTATICLIB =
export DRIVERLIB =
export LINKDRIVER =
export DRIVERRES =
export DRIVERRC =
endif
DRIVERBUILDDIRS = driver
#
# ITERATOR HEADERS
#
ITERHDR0 = \
ranges-add ranges-append ranges-array ranges-cache \
ranges-compl ranges-diff ranges-empty \
ranges-inter ranges-minmax ranges-minus \
ranges-offset ranges-operations ranges-rangelist \
ranges-scale ranges-singleton ranges-singleton-append \
ranges-size ranges-union ranges-values \
ranges-negative ranges-positive ranges-map \
ranges-list \
values-array values-minus values-offset values-ranges \
values-positive values-negative \
values-singleton values-unique values-inter \
values-union values-map values-bitset values-list
ITERHDR = gecode/iter.hh \
$(ITERHDR0:%=gecode/iter/%.hpp)
#
# GIST
#
GISTHDR0 = \
drawingcursor.hh drawingcursor.hpp \
gist.hpp gecodelogo.hh node.hh node.hpp \
nodecursor.hh nodecursor.hpp nodevisitor.hh \
nodevisitor.hpp layoutcursor.hh layoutcursor.hpp \
spacenode.hh spacenode.hpp qtgist.hh \
textoutput.hh treecanvas.hh zoomToFitIcon.hpp \
visualnode.hh visualnode.hpp nodestats.hh \
nodewidget.hh mainwindow.hh preferences.hh \
stopbrancher.hh
GISTSRC0 = \
drawingcursor.cpp gist.cpp gecodelogo.cpp node.cpp \
spacenode.cpp \
textoutput.cpp treecanvas.cpp qtgist.cpp visualnode.cpp nodestats.cpp \
nodewidget.cpp mainwindow.cpp preferences.cpp stopbrancher.cpp
GISTMOCSRC0 = \
moc_treecanvas.cpp moc_qtgist.cpp moc_mainwindow.cpp moc_textoutput.cpp\
moc_preferences.cpp moc_nodestats.cpp
GISTSRC = $(GISTSRC0:%=gecode/gist/%)
GISTMOCSRC = $(GISTMOCSRC0:%=gecode/gist/%)
GISTHDR = $(GISTHDR0:%=gecode/gist/%) gecode/gist.hh
GISTOBJ = $(GISTSRC:%.cpp=%$(OBJSUFFIX)) $(GISTMOCSRC:%.cpp=%$(OBJSUFFIX))
GISTSBJ = $(GISTSRC:%.cpp=%$(SBJSUFFIX)) $(GISTMOCSRC:%.cpp=%$(SBJSUFFIX))
GISTBUILDDIRS = gist
ifeq "" "yes"
export GISTDLL = $(LIBPREFIX)gist$(DLLSUFFIX)
export GISTSTATICLIB = $(LIBPREFIX)gist$(STATICLIBSUFFIX)
export GISTLIB = $(LIBPREFIX)gist$(LIBSUFFIX)
export LINKGIST = $(LINKPREFIX)gist$(LINKSUFFIX)
ifeq "no" "yes"
export GISTSONAME = \
$(LIBPREFIX)gist$(SOSUFFIX)
else
export GISTSONAME =
endif
ifeq "no" "yes"
export GISTRC = $(LIBPREFIX)gist$(RCSUFFIX)
export GISTRES = $(LIBPREFIX)gist$(RESSUFFIX)
else
export GISTRES =
export GISTRC =
endif
else
export GISTDLL =
export GISTSTATICLIB =
export GISTLIB =
export LINKGIST =
export GISTSONAME =
export GISTRES =
export GISTRC =
endif
#
# FLATZINC
#
FLATZINCSRC0 = flatzinc.cpp registry.cpp
FLATZINC_GENSRC0 = parser.tab.cpp lexer.yy.cpp
FLATZINCHDR0 = ast.hh conexpr.hh option.hh parser.hh \
plugin.hh registry.hh symboltable.hh varspec.hh
FLATZINCSRC = $(FLATZINCSRC0:%=gecode/flatzinc/%)
FLATZINC_GENSRC = $(FLATZINC_GENSRC0:%=gecode/flatzinc/%)
FLATZINCHDR = $(FLATZINCHDR0:%=gecode/flatzinc/%) gecode/flatzinc.hh
FLATZINCOBJ = \
$(FLATZINCSRC:%.cpp=%$(OBJSUFFIX)) \
$(FLATZINC_GENSRC:%.cpp=%$(OBJSUFFIX))
FLATZINCEXESRC0 = fz.cpp
FLATZINCEXESRC = $(FLATZINCEXESRC0:%=tools/flatzinc/%)
FLATZINCEXEOBJ = $(FLATZINCEXESRC:%.cpp=%$(OBJSUFFIX))
FLATZINCALLSRC = $(FLATZINCSRC) $(FLATZINCEXESRC)
FLATZINCBUILDDIRS = gecode/flatzinc tools/flatzinc
ifeq "yes" "yes"
export FLATZINCDLL = $(LIBPREFIX)flatzinc$(DLLSUFFIX)
export FLATZINCSTATICLIB = $(LIBPREFIX)flatzinc$(STATICLIBSUFFIX)
export FLATZINCLIB = $(LIBPREFIX)flatzinc$(LIBSUFFIX)
export LINKFLATZINC = $(LINKPREFIX)flatzinc$(LINKSUFFIX)
export FLATZINCMZNLIB = gecode/flatzinc/mznlib
FLATZINCEXE = tools/flatzinc/fz$(EXESUFFIX)
ifeq "no" "yes"
export FLATZINCSONAME = $(LIBPREFIX)flatzinc$(SOSUFFIX)
else
export FLATZINCSONAME =
endif
ifeq "no" "yes"
export FLATZINCRC = $(LIBPREFIX)flatzinc$(RCSUFFIX)
export FLATZINCRES = $(LIBPREFIX)flatzinc$(RESSUFFIX)
else
export FLATZINCRES =
export FLATZINCRC =
endif
else
export FLATZINCDLL =
export FLATZINCSTATICLIB =
export FLATZINCLIB =
export LINKFLATZINC =
export FLATZINCSONAME =
export FLATZINCMZNLIB =
export FLATZINCRES =
export FLATZINCRC =
FLATZINCEXE =
endif
#
# EXAMPLES
#
INTEXAMPLEHDR0 = \
scowl
INTEXAMPLESRC0 = \
alpha bacp bibd donald efpa eq20 golomb-ruler \
graph-color grocery ind-set magic-sequence magic-square \
money ortho-latin partition photo queens sudoku kakuro \
nonogram pentominoes crowded-chess black-hole \
minesweeper domino steel-mill sports-league \
all-interval langford-number warehouses radiotherapy \
word-square crossword open-shop car-sequencing sat \
bin-packing knights tsp perfect-square schurs-lemma \
dominating-queens
INTEXAMPLEHDR = $(INTEXAMPLEHDR0:%=examples/%.hpp)
INTEXAMPLESRC = $(INTEXAMPLESRC0:%=examples/%.cpp)
ifeq "yes" "yes"
INTEXAMPLEEXE = $(INTEXAMPLESRC:%.cpp=%$(EXESUFFIX))
else
INTEXAMPLEEXE =
endif
SETEXAMPLESRC0 = \
crew golf hamming steiner queen-armies
SETEXAMPLESRC = $(SETEXAMPLESRC0:%=examples/%.cpp)
ifeq "yes" "yes"
SETEXAMPLEEXE = $(SETEXAMPLESRC:%.cpp=%$(EXESUFFIX))
else
SETEXAMPLEEXE =
endif
EXAMPLEBUILDDIRS = examples
EXAMPLEEXE = \
$(INTEXAMPLEEXE) $(SETEXAMPLEEXE)
#
# COLLECTING ALL
#
ALLSRC = \
$(SUPPORTSRC) $(KERNELSRC) $(SEARCHSRC) \
$(INTSRC) $(SETSRC) $(MMSRC) $(DRIVERSRC) \
$(INTEXAMPLESRC) $(SETEXAMPLESRC) \
$(GISTSRC) $(FLATZINCALLSRC)
ALLHDR = \
$(SUPPORTHDR) $(KERNELHDR) $(SEARCHHDR) \
$(INTHDR) $(SETHDR) $(MMHDR) \
$(DRIVERHDR) $(ITERHDR) $(GISTHDR) $(FLATZINCHDR) \
$(INTEXAMPLEHDR)
ALLOBJ0 = $(ALLSRC:%.cpp=%$(OBJSUFFIX)) \
$(GISTMOCSRC:%.cpp=%$(OBJSUFFIX)) \
$(FLATZINC_GENSRC:%.cpp=%$(OBJSUFFIX))
ALLOBJ = $(ALLOBJ0:%.c=%$(OBJSUFFIX))
ALLSBJ0 = $(ALLSRC:%.cpp=%$(SBJSUFFIX))
ALLSBJ = $(ALLSBJ0:%.c=%$(SBJSUFFIX))
ifeq "no" "yes"
DLLTARGETS= \
$(SUPPORTDLL) $(KERNELDLL) $(SEARCHDLL) $(INTDLL) $(SETDLL) \
$(MMDLL) $(DRIVERDLL) $(GISTDLL) $(FLATZINCDLL)
export ALLLIB = \
$(SUPPORTLIB) $(KERNELLIB) $(SEARCHLIB) $(INTLIB) $(SETLIB) \
$(MMLIB) $(DRIVERLIB) $(GISTLIB) $(FLATZINCLIB)
else
DLLTARGETS=
ifeq "" "yes"
export ALLLIB = gecode.framework/Versions/32/gecode
else
export ALLLIB = \
$(SUPPORTSTATICLIB) $(KERNELSTATICLIB) $(SEARCHSTATICLIB) \
$(INTSTATICLIB) $(SETSTATICLIB) $(MMSTATICLIB) \
$(DRIVERSTATICLIB) $(GISTSTATICLIB) $(FLATZINCSTATICLIB)
endif
endif
ifeq "yes" "yes"
STATICTARGETS = \
$(SUPPORTSTATICLIB) $(KERNELSTATICLIB) $(SEARCHSTATICLIB) \
$(INTSTATICLIB) $(SETSTATICLIB) $(MMSTATICLIB) \
$(DRIVERSTATICLIB) $(GISTSTATICLIB) $(FLATZINCSTATICLIB)
else
STATICTARGETS=
endif
export LIBTARGETS = $(DLLTARGETS) $(STATICTARGETS)
ifeq "no" "yes"
export LIBLINKTARGETS = \
$(DLLTARGETS:%$(DLLSUFFIX)=%$(SOSUFFIX)) \
$(DLLTARGETS:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
else
export LIBLINKTARGETS =
endif
PDBS = $(ALLLIB:%$(LIBSUFFIX)=%$(PDBSUFFIX))
ifeq "no" "yes"
LIBLIBTARGETS = $(ALLLIB)
PDBTARGETS = $(PDBS)
else
LIBLIBTARGETS =
PDBTARGETS =
endif
EXETARGETS = $(FLATZINCEXE) tools/flatzinc/mzn-gecode.bat
#
# Testing
#
INTTESTSRC00 = \
channel arithmetic basic bool count dom distinct element extensional \
rel linear gcc sorted unshare exec sequence \
mm-arithmetic mm-bool mm-lin mm-count mm-rel \
bin-packing unary cumulative cumulatives circuit \
no-overlap precede nvalues member
INTTESTSRC0 = test/int.cpp $(INTTESTSRC00:%=test/int/%.cpp)
INTTESTOBJ = $(INTTESTSRC0:%.cpp=%$(OBJSUFFIX))
SETTESTSRC00 = \
construct dom rel rel-op rel-op-const convex sequence int element \
precede distinct exec mm-set
SETTESTSRC0 = test/set.cpp $(SETTESTSRC00:%=test/set/%.cpp)
ifeq "yes" "yes"
SETTESTOBJ = $(SETTESTSRC0:%.cpp=%$(OBJSUFFIX))
else
SETTESTOBJ=
endif
BRANCHTESTSRC0 = \
test/branch.cpp test/branch/int.cpp test/branch/bool.cpp \
test/branch/set.cpp \
test/assign.cpp test/assign/int.cpp test/assign/bool.cpp \
test/assign/set.cpp
SEARCHTESTSRC0 = \
test/search.cpp
ARRAYTESTSRC0 = \
test/array.cpp
TESTSRC0 = test/test.cpp test/afc.cpp
TESTSRC = \
$(TESTSRC0) $(INTTESTSRC0) $(SETTESTSRC0) \
$(BRANCHTESTSRC0) $(SEARCHTESTSRC0) \
$(ARRAYTESTSRC0)
TESTHDR0 = \
test.hh test.hpp int.hh int.hpp set.hh set.hpp \
branch.hh assign.hh
TESTHDR = $(TESTHDR0:%=test/%)
TESTOBJ = $(INTTESTOBJ) $(SETTESTOBJ) \
$(BRANCHTESTSRC0:%.cpp=%$(OBJSUFFIX)) \
$(SEARCHTESTSRC0:%.cpp=%$(OBJSUFFIX)) \
$(ARRAYTESTSRC0:%.cpp=%$(OBJSUFFIX)) \
$(TESTSRC0:%.cpp=%$(OBJSUFFIX))
TESTSBJ = $(TESTOBJ:%$(OBJSUFFIX)=%$(SBJSUFFIX))
TESTEXE = test/test$(EXESUFFIX)
TESTBUILDDIRS = test test/int test/set test/branch test/assign
BUILDDIRS = \
tools \
$(SUPPORTBUILDDIRS:%=gecode/%) \
$(KERNELBUILDDIRS:%=gecode/%) $(SEARCHBUILDDIRS:%=gecode/%) \
$(INTBUILDDIRS:%=gecode/%) $(SETBUILDDIRS:%=gecode/%) \
$(MMBUILDDIRS:%=gecode/%) \
$(DRIVERBUILDDIRS:%=gecode/%) \
$(GISTBUILDDIRS:%=gecode/%) \
$(FLATZINCBUILDDIRS) \
$(EXAMPLEBUILDDIRS) $(TESTBUILDDIRS)
ifeq "no" "yes"
all: compilelib
@$(MAKE) compileexamples
@$(MAKE) makecompletedmessage
else
all: compilelib
@$(MAKE) makecompletedmessage
endif
compilelib: mkcompiledirs
@$(MAKE) $(VARIMP) $(LIBTARGETS)
@$(MAKE) compilesubdirs
@$(MAKE) framework
@$(MAKE) flatzinc
compileexamples: $(EXAMPLEEXE)
test: mkcompiledirs
@$(MAKE) $(VARIMP) $(TESTEXE)
# A basic integrity test
check: test
$(TESTEXE) -iter 2 -test Branch::Int::Dense::3 \
-test Int::Linear::Int::Int::Eq::Bnd::12::4 \
-test Int::Distinct::Random \
-test Int::Arithmetic::Mult::XYZ::Bnd::C \
-test Int::Arithmetic::Mult::XYZ::Dom::A \
-test Search::BAB::Sol::BalGr::Binary::Binary::Binary::1::1
ifeq "." "."
mkcompiledirs:
else
mkcompiledirs:
for_builddirs="$(BUILDDIRS)"; for f in $$for_builddirs; do \
(test -z "$(top_builddir)"/$$f || mkdir -p "$(top_builddir)"/$$f); \
done
endif
makecompletedmessage:
@echo
@echo Compilation of Gecode finished successfully. To use Gecode, either add
@echo $(PWD)
@echo to your search path for libraries, or install Gecode using
@echo make install
@echo
# ugly hack by Gr�goire Dooms to call a target on a contribs after evaluating all the variables in this Makefile.
# used as make contribs:cpgraph:doc or make contribs:cpgraph:Makefile.in
.PHONY: contribs\:%
contribs\:%:
$(MAKE) -C $(shell echo $@ | sed 's/\(contribs:[^:]*\):.*/\1/;s+:+/+') $(shell echo $@ | sed 's/contribs:[^:]*:\(.*\)/\1/;s+:+/+')
# less ugly hack by Guido Tack to call a target
# Just give ICD (in-contrib-dir) and ICT (in-contrib-target) as arguments
# to make incontrib
ICT=
ICD=
.PHONY: incontrib
incontrib:
$(MAKE) -C contribs/$(ICD) $(ICT)
compilesubdirs:
@for_subdirs="$(subdirs)"; for i in $$for_subdirs; do \
if test -f $$i/Makefile; then \
echo "Making in directory $$i"; \
$(MAKE) -C $$i; \
fi; \
done
#
# Generated variable implementations
#
VIS = $(top_srcdir)/gecode/int/var-imp/int.vis $(top_srcdir)/gecode/int/var-imp/bool.vis $(top_srcdir)/gecode/set/var-imp/set.vis
VISDEP = $(VIS) \
$(top_srcdir)/misc/genvarimp.perl Makefile
gecode/kernel/var-type.hpp: $(VISDEP)
perl $(top_srcdir)/misc/genvarimp.perl -typehpp $(VIS) > $@
gecode/kernel/var-imp.hpp: $(VISDEP)
perl $(top_srcdir)/misc/genvarimp.perl -header $(VIS) > $@
#
# Generated branchers
#
GENBRANCHSRC = \
$(top_srcdir)/gecode/int/branch/post-view-int.cpp \
$(top_srcdir)/gecode/int/branch/post-view-bool.cpp \
$(top_srcdir)/gecode/set/branch/post-view.cpp
$(top_srcdir)/gecode/int/branch/post-view-int.cpp: \
$(top_srcdir)/gecode/int/branch/post-view-int.bs \
$(top_srcdir)/misc/genbranch.perl
perl $(top_srcdir)/misc/genbranch.perl $< > $@
$(top_srcdir)/gecode/int/branch/post-view-bool.cpp: \
$(top_srcdir)/gecode/int/branch/post-view-bool.bs \
$(top_srcdir)/misc/genbranch.perl
perl $(top_srcdir)/misc/genbranch.perl $< > $@
$(top_srcdir)/gecode/set/branch/post-view.cpp: \
$(top_srcdir)/gecode/set/branch/post-view.bs \
$(top_srcdir)/misc/genbranch.perl
perl $(top_srcdir)/misc/genbranch.perl $< > $@
#
# Object targets
#
gecode/support/%$(OBJSUFFIX): $(top_srcdir)/gecode/support/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_SUPPORT \
-c -o $@ $<
gecode/support/%$(SBJSUFFIX): $(top_srcdir)/gecode/support/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_SUPPORT \
-S -o $@ $<
gecode/support/%$(OBJSUFFIX): $(top_srcdir)/gecode/support/%.c
$(CC) $(CFLAGS) -DGECODE_BUILD_SUPPORT \
-c -o $@ $<
gecode/support/%$(SBJSUFFIX): $(top_srcdir)/gecode/support/%.c
$(CC) $(CFLAGS) -DGECODE_BUILD_SUPPORT \
-S -o $@ $<
gecode/kernel/%$(OBJSUFFIX): $(top_srcdir)/gecode/kernel/%.cpp
$(CXX) $(CXXFLAGS) $(BOOST_CPPFLAGS) -DGECODE_BUILD_KERNEL \
-c -o $@ $<
gecode/kernel/%$(SBJSUFFIX): $(top_srcdir)/gecode/kernel/%.cpp
$(CXX) $(CXXFLAGS) $(BOOST_CPPFLAGS) -DGECODE_BUILD_KERNEL \
-S -o $@ $<
gecode/search/%$(OBJSUFFIX): $(top_srcdir)/gecode/search/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_SEARCH \
-c -o $@ $<
gecode/search/%$(SBJSUFFIX): $(top_srcdir)/gecode/search/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_SEARCH \
-S -o $@ $<
gecode/int/%$(OBJSUFFIX): $(top_srcdir)/gecode/int/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_INT \
-c -o $@ $<
gecode/int/%$(SBJSUFFIX): $(top_srcdir)/gecode/int/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_INT \
-S -o $@ $<
gecode/set/%$(OBJSUFFIX): $(top_srcdir)/gecode/set/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_SET \
-c -o $@ $<
gecode/set/%$(SBJSUFFIX): $(top_srcdir)/gecode/set/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_SET \
-S -o $@ $<
gecode/minimodel/%$(OBJSUFFIX): $(top_srcdir)/gecode/minimodel/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_MINIMODEL \
-c -o $@ $<
gecode/minimodel/%$(SBJSUFFIX): $(top_srcdir)/gecode/minimodel/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_MINIMODEL \
-S -o $@ $<
gecode/driver/%$(OBJSUFFIX): $(top_srcdir)/gecode/driver/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_DRIVER \
-c -o $@ $<
gecode/driver/%$(SBJSUFFIX): $(top_srcdir)/gecode/driver/%.cpp
$(CXX) $(CXXFLAGS) -DGECODE_BUILD_DRIVER \
-S -o $@ $<
examples/%$(OBJSUFFIX): $(top_srcdir)/examples/%.cpp
$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) $(BOOST_CPPFLAGS) $(QT_CPPFLAGS) \
-c -o $@ $<
examples/%$(SBJSUFFIX): $(top_srcdir)/examples/%.cpp
$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) $(BOOST_CPPFLAGS) $(QT_CPPFLAGS) \
-S -o $@ $<
test/%$(OBJSUFFIX): $(top_srcdir)/test/%.cpp
$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) \
-c -o $@ $<
test/%$(SBJSUFFIX): $(top_srcdir)/test/%.cpp
$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) \
-S -o $@ $<
tools/%$(OBJSUFFIX): $(top_srcdir)/tools/%.cpp
$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) \
-c -o $@ $<
tools/%$(SBJSUFFIX): $(top_srcdir)/tools/%.cpp
$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) \
-S -o $@ $<
$(GISTSRC:%.cpp=%$(OBJSUFFIX)): gecode/gist/%$(OBJSUFFIX): $(top_srcdir)/gecode/gist/%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_GIST \
-c -o $@ $<
$(GISTSRC:%.cpp=%$(SBJSUFFIX)): gecode/gist/%$(SBJSUFFIX): $(top_srcdir)/gecode/gist/%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_GIST \
-S -o $@ $<
$(GISTMOCSRC:%.cpp=%$(OBJSUFFIX)): gecode/gist/moc_%$(OBJSUFFIX): gecode/gist/moc_%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_GIST \
-c -o $@ $<
$(GISTMOCSRC:%.cpp=%$(SBJSUFFIX)): gecode/gist/moc_%$(SBJSUFFIX): gecode/gist/moc_%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_GIST \
-S -o $@ $<
.PRECIOUS: gecode/gist/moc_%.cpp
gecode/gist/moc_%.cpp: $(top_srcdir)/gecode/gist/%.hh
$(MOC) $(CPPFLAGS) -pgecode/gist $< -o $@
.PRECIOUS: gecode/flatzinc/%.cpp gecode/flatzinc/%.hh
ifeq "yes" "yes"
gecode/flatzinc/lexer.yy.cpp: \
$(top_srcdir)/gecode/flatzinc/lexer.lxx \
$(top_srcdir)/gecode/flatzinc/parser.tab.hh
flex -ogecode/flatzinc/lexer.yy.cpp \
$(top_srcdir)/gecode/flatzinc/lexer.lxx
gecode/flatzinc/parser.tab.hh gecode/flatzinc/parser.tab.cpp: \
$(top_srcdir)/gecode/flatzinc/parser.yxx
bison -t -o gecode/flatzinc/parser.tab.cpp -d $<
mv gecode/flatzinc/parser.tab.hpp gecode/flatzinc/parser.tab.hh
else
ifneq "$(top_srcdir)" "."
gecode/flatzinc/lexer.yy.cpp: $(top_srcdir)/gecode/flatzinc/lexer.yy.cpp
cp $(@:%=$(top_srcdir)/%) $@
gecode/flatzinc/parser.tab.hh: $(top_srcdir)/gecode/flatzinc/parser.tab.hh
cp $(@:%=$(top_srcdir)/%) $@
gecode/flatzinc/parser.tab.cpp: $(top_srcdir)/gecode/flatzinc/parser.tab.cpp
cp $(@:%=$(top_srcdir)/%) $@
endif
endif
$(FLATZINCSRC:%.cpp=%$(OBJSUFFIX)): gecode/flatzinc/%$(OBJSUFFIX): $(top_srcdir)/gecode/flatzinc/%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_FLATZINC \
-c -o $@ $<
$(FLATZINCSRC:%.cpp=%$(SBJSUFFIX)): gecode/flatzinc/%$(SBJSUFFIX): $(top_srcdir)/gecode/flatzinc/%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_FLATZINC \
-S -o $@ $<
$(FLATZINC_GENSRC:%.cpp=%$(OBJSUFFIX)): gecode/flatzinc/%$(OBJSUFFIX): gecode/flatzinc/%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_FLATZINC \
-c -o $@ $<
$(FLATZINC_GENSRC:%.cpp=%$(SBJSUFFIX)): gecode/flatzinc/%$(SBJSUFFIX): gecode/flatzinc/%.cpp
$(CXX) $(CXXFLAGS) $(QT_CPPFLAGS) \
-DGECODE_BUILD_FLATZINC \
-S -o $@ $<
#
# DLL Targets
#
ifeq "$(DLLSUFFIX)" "$(LIBSUFFIX)"
ifeq "" "yes"
export LINKALL = -F. -framework gecode
else
export LINKALL = \
$(LINKFLATZINC) $(LINKDRIVER) $(LINKGIST) \
$(LINKSEARCH) $(LINKMM) $(LINKSET) $(LINKINT) \
$(LINKKERNEL) $(LINKSUPPORT)
endif
$(SUPPORTDLL): $(SUPPORTOBJ)
$(CXX) $(DLLFLAGS) $(SUPPORTOBJ) $(SUPPORTSONAME) \
-o $(SUPPORTDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(KERNELDLL): $(KERNELOBJ) $(SUPPORTDLL)
$(CXX) $(DLLFLAGS) $(KERNELOBJ) $(KERNELSONAME) \
-L. $(LINKSUPPORT) \
-o $(KERNELDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(SEARCHDLL): $(SEARCHOBJ) $(SUPPORTDLL) $(KERNELDLL)
$(CXX) $(DLLFLAGS) $(SEARCHOBJ) $(SEARCHSONAME) \
-L. $(LINKSUPPORT) $(LINKKERNEL) \
-o $(SEARCHDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(INTDLL): $(INTOBJ) $(SUPPORTDLL) $(KERNELDLL)
$(CXX) $(DLLFLAGS) $(INTOBJ) $(INTSONAME) \
-L. $(LINKSUPPORT) $(LINKKERNEL) \
-o $(INTDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(SETDLL): $(SETOBJ) $(SUPPORTDLL) $(KERNELDLL) $(INTDLL)
$(CXX) $(DLLFLAGS) $(SETOBJ) $(SETSONAME) \
-L. $(LINKSUPPORT) $(LINKKERNEL) $(LINKINT) \
-o $(SETDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(MMDLL): $(MMOBJ) $(SUPPORTDLL) $(KERNELDLL) $(INTDLL) $(SETDLL)
$(CXX) $(DLLFLAGS) $(MMOBJ) $(MMSONAME) \
-L. $(LINKSUPPORT) $(LINKKERNEL) $(LINKINT) $(LINKSET) \
-o $(MMDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(DRIVERDLL): $(DRIVEROBJ) $(SUPPORTDLL) $(KERNELDLL) $(SEARCHDLL) $(INTDLL) $(MMDLL) $(GISTDLL)
$(CXX) $(DLLFLAGS) $(DRIVEROBJ) $(DRIVERSONAME) \
-L. $(LINKSUPPORT) $(LINKKERNEL) $(LINKSEARCH) $(LINKINT) $(LINKMM) $(LINKGIST) \
-o $(DRIVERDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(GISTDLL): $(GISTOBJ) $(SUPPORTDLL) $(KERNELDLL) $(SEARCHDLL) $(INTDLL)
$(CXX) $(DLLFLAGS) $(GISTOBJ) $(GISTSONAME) \
-L. $(LINKSUPPORT) $(LINKKERNEL) $(LINKSEARCH) $(LINKINT) $(LINKQT) \
-o $(GISTDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(FLATZINCDLL): $(FLATZINCOBJ) $(SUPPORTDLL) $(KERNELDLL) $(SEARCHDLL) \
$(INTDLL) $(SETDLL) $(GISTDLL) $(MMDLL) $(DRIVERDLL)
$(CXX) $(DLLFLAGS) $(FLATZINCOBJ) $(FLATZINCSONAME) \
-L. $(LINKSUPPORT) $(LINKKERNEL) $(LINKSEARCH) $(LINKINT) \
$(LINKSET) $(LINKMM) $(LINKGIST) $(LINKDRIVER) $(LINKQT) \
-o $(FLATZINCDLL)
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOLINKSUFFIX))
$(CREATELINK) $@ $(@:%$(DLLSUFFIX)=%$(SOSUFFIX))
else
export LINKALL =
ifeq "no" "yes"
$(SUPPORTRC):
$(RCGEN) $(SUPPORTDLL) $(SUPPORTHDR) $(SUPPORTSRC) > $@
endif
$(SUPPORTDLL) $(SUPPORTLIB): $(SUPPORTOBJ) $(SUPPORTRES)
$(CXX) $(DLLFLAGS) $(SUPPORTOBJ) $(SUPPORTRES) \
-o $(SUPPORTDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(SUPPORTDLL).manifest
$(MANIFEST) -manifest $(SUPPORTDLL).manifest \
-outputresource:$(SUPPORTDLL)\;2
ifeq "no" "yes"
$(KERNELRC):
$(RCGEN) $(KERNELDLL) $(KERNELHDR) $(VARIMPHDR) $(KERNELSRC) > $@
endif
$(KERNELDLL) $(KERNELLIB): $(KERNELOBJ) $(KERNELRES) $(SUPPORTDLL)
$(CXX) $(DLLFLAGS) $(KERNELOBJ) $(KERNELRES) \
-L. -o $(KERNELDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(KERNELDLL).manifest
$(MANIFEST) -manifest $(KERNELDLL).manifest \
-outputresource:$(KERNELDLL)\;2
ifeq "no" "yes"
$(SEARCHRC):
$(RCGEN) $(SEARCHDLL) $(SEARCHHDR) $(SEARCHSRC) > $@
endif
$(SEARCHDLL) $(SEARCHLIB): $(SEARCHOBJ) $(SEARCHRES) $(SUPPORTDLL) $(KERNELDLL)
$(CXX) $(DLLFLAGS) $(SEARCHOBJ) $(SEARCHRES) \
-L. -o $(SEARCHDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(SEARCHDLL).manifest
$(MANIFEST) -manifest $(SEARCHDLL).manifest \
-outputresource:$(SEARCHDLL)\;2
ifeq "no" "yes"
$(INTRC):
$(RCGEN) $(INTDLL) $(INTHDR) $(INTSRC) > $@
endif
$(INTDLL) $(INTLIB): $(INTOBJ) $(INTRES) $(SUPPORTDLL) $(KERNELDLL)
$(CXX) $(DLLFLAGS) $(INTOBJ) $(INTRES) \
-L. -o $(INTDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(INTDLL).manifest
$(MANIFEST) -manifest $(INTDLL).manifest \
-outputresource:$(INTDLL)\;2
ifeq "no" "yes"
$(SETRC):
$(RCGEN) $(SETDLL) $(SETHDR) $(SETSRC) > $@
endif
$(SETDLL) $(SETLIB): $(SETOBJ) $(SETRES) $(SUPPORTDLL) $(KERNELDLL) $(INTDLL)
$(CXX) $(DLLFLAGS) $(SETOBJ) $(SETRES) \
-L. -o $(SETDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(SETDLL).manifest
$(MANIFEST) -manifest $(SETDLL).manifest \
-outputresource:$(SETDLL)\;2
ifeq "no" "yes"
$(MMRC):
$(RCGEN) $(MMDLL) $(MMHDR) $(MMSRC) > $@
endif
$(MMDLL) $(MMLIB): $(MMOBJ) $(MMRES) \
$(SUPPORTDLL) $(KERNELDLL) $(INTDLL) $(SETDLL)
$(CXX) $(DLLFLAGS) $(MMOBJ) $(MMRES) \
-L. -o $(MMDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(MMDLL).manifest
$(MANIFEST) -manifest $(MMDLL).manifest \
-outputresource:$(MMDLL)\;2
ifeq "no" "yes"
$(DRIVERRC):
$(RCGEN) $(DRIVERDLL) $(DRIVERHDR) $(DRIVERSRC) > $@
endif
$(DRIVERDLL) $(DRIVERLIB): $(DRIVEROBJ) $(DRIVERRES) \
$(SUPPORTDLL) $(KERNELDLL) \
$(SEARCHDLL) $(INTDLL) $(MMDLL) $(GISTDLL)
$(CXX) $(DLLFLAGS) $(DRIVEROBJ) $(DRIVERRES) \
-L. -o $(DRIVERDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(DRIVERDLL).manifest
$(MANIFEST) -manifest $(DRIVERDLL).manifest \
-outputresource:$(DRIVERDLL)\;2
ifeq "no" "yes"
$(GISTRC):
$(RCGEN) $(GISTDLL) $(GISTHDR) $(GISTSRC) > $@
endif
$(GISTDLL) $(GISTLIB): $(GISTOBJ) $(GISTRES) \
$(SUPPORTDLL) $(KERNELDLL) $(SEARCHDLL) $(INTDLL)
$(CXX) $(DLLFLAGS) $(GISTOBJ) $(GISTRES) \
-L. $(LINKQT) -o $(GISTDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(GISTDLL).manifest
$(MANIFEST) -manifest $(GISTDLL).manifest \
-outputresource:$(GISTDLL)\;2
ifeq "no" "yes"
$(FLATZINCRC):
$(RCGEN) $(FLATZINCDLL) $(FLATZINCHDR) $(FLATZINCSRC) > $@
endif
$(FLATZINCDLL) $(FLATZINCLIB): $(FLATZINCOBJ) $(FLATZINCRES) \
$(SUPPORTDLL) $(KERNELDLL) $(SEARCHDLL) $(INTDLL) \
$(SETDLL) $(GISTDLL) $(MMDLL) $(DRIVERDLL)
$(CXX) $(DLLFLAGS) $(FLATZINCOBJ) $(FLATZINCRES) \
-L. $(LINKQT) -o $(FLATZINCDLL) $(GLDFLAGS)
$(FIXMANIFEST) $(FLATZINCDLL).manifest
$(MANIFEST) -manifest $(FLATZINCDLL).manifest \
-outputresource:$(FLATZINCDLL)\;2
endif
#
# Static libraries
#
$(SUPPORTSTATICLIB): $(SUPPORTOBJ)
$(AR) $(ARFLAGS) $@ $(SUPPORTOBJ)
$(RANLIB) $@
$(KERNELSTATICLIB): $(KERNELOBJ)
$(AR) $(ARFLAGS) $@ $(KERNELOBJ)
$(RANLIB) $@
$(SEARCHSTATICLIB): $(SEARCHOBJ)
$(AR) $(ARFLAGS) $@ $(SEARCHOBJ)
$(RANLIB) $@
$(INTSTATICLIB): $(INTOBJ)
$(AR) $(ARFLAGS) $@ $(INTOBJ)
$(RANLIB) $@
$(SETSTATICLIB): $(SETOBJ)
$(AR) $(ARFLAGS) $@ $(SETOBJ)
$(RANLIB) $@
$(MMSTATICLIB): $(MMOBJ)
$(AR) $(ARFLAGS) $@ $(MMOBJ)
$(RANLIB) $@
$(DRIVERSTATICLIB): $(DRIVEROBJ)
$(AR) $(ARFLAGS) $@ $(DRIVEROBJ)
$(RANLIB) $@
$(GISTSTATICLIB): $(GISTOBJ)
$(AR) $(ARFLAGS) $@ $(GISTOBJ)
$(RANLIB) $@
$(FLATZINCSTATICLIB): $(FLATZINCOBJ)
$(AR) $(ARFLAGS) $@ $(FLATZINCOBJ)
$(RANLIB) $@
#
# Mac OS X Framework
#
.PHONY: framework
ifeq "" "yes"
framework: gecode.framework/Versions/32/gecode
gecode.framework/Versions/32/gecode: $(STATICTARGETS)
$(RMF) gecode.framework
mkdir -p gecode.framework/Versions/32
$(CXX) -all_load -compatibility_version 32.0 \
-current_version 32.0 \
$(DLLFLAGS) $(LINKQT) \
-o gecode.framework/Versions/32/gecode $^
$(MAKE) doinstallheaders \
prefix=gecode.framework/Versions/32 DESTDIR=
mv gecode.framework/Versions/32/include/gecode/* \
gecode.framework/Versions/32/include/
rmdir gecode.framework/Versions/32/include/gecode
cd gecode.framework/Versions && ln -s 32 Current
ln -s Versions/Current/include \
gecode.framework/Headers
ln -s Versions/Current/gecode \
gecode.framework/gecode
else
framework:
endif
#
# EXE Targets
#
.PRECIOUS: examples/%$(OBJSUFFIX)
ifeq "no" "yes"
.PRECIOUS: examples/%$(EXESUFFIX).rc examples/%$(EXESUFFIX).res
examples/%$(EXESUFFIX).rc:
$(RCGEN) $(@:%.rc=%) $< > $@
examples/%$(EXESUFFIX): examples/%$(OBJSUFFIX) examples/%$(EXESUFFIX).res \
$(ALLLIB)
$(CXX) -o $@ $< $@.res \
$(DLLPATH) $(CXXFLAGS) \
$(LINKALL) $(LINKQT) $(GLDFLAGS)
$(FIXMANIFEST) $@.manifest
$(MANIFEST) -manifest $@.manifest -outputresource:$@\;1
else
examples/%$(EXESUFFIX): examples/%$(OBJSUFFIX) $(ALLLIB)
$(CXX) -o $@ $< $(DLLPATH) $(CXXFLAGS) \
$(LINKALL) $(LINKQT) $(GLDFLAGS)
$(FIXMANIFEST) $@.manifest
$(MANIFEST) -manifest $@.manifest -outputresource:$@\;1
endif
ifeq "no" "yes"
TESTRES = $(TESTEXE).res
$(TESTEXE).rc:
$(RCGEN) $(TESTEXE) $(TESTSRC) $(TESTHDR) > $@
else
TESTRES =
endif
$(TESTEXE): $(TESTOBJ) $(TESTRES) $(ALLLIB)
$(CXX) -o $@ $(TESTOBJ) $(TESTRES) $(DLLPATH) $(CXXFLAGS) \
$(LINKALL) $(GLDFLAGS)
$(FIXMANIFEST) $@.manifest $(DLLSUFFIX)
$(MANIFEST) -manifest $@.manifest -outputresource:$@\;1
.PHONY: flatzinc
ifeq "yes" "yes"
flatzinc: $(FLATZINCEXE)
else
flatzinc:
endif
ifeq "no" "yes"
FLATZINCEXERES = $(FLATZINCEXE).res
$(FLATZINCEXE).rc:
$(RCGEN) $(FLATZINCEXE) $(FLATZINCEXESRC) > $@
else
FLATZINCEXERES =
endif
$(FLATZINCEXE): $(FLATZINCEXEOBJ) $(FLATZINCEXERES) $(ALLLIB)
$(CXX) -o $@ $(FLATZINCEXEOBJ) $(FLATZINCEXERES) \
$(DLLPATH) $(CXXFLAGS) \
$(LINKALL) $(LINKSTATICQT) $(GLDFLAGS)
$(FIXMANIFEST) $@.manifest
$(MANIFEST) -manifest $@.manifest -outputresource:$@\;1
#
# Autoconf
#
$(top_srcdir)/configure: $(top_srcdir)/configure.ac
(cd $(top_srcdir) && autoconf)
config.status: $(top_srcdir)/configure
./config.status --recheck
Makefile: $(top_srcdir)/Makefile.in config.status
./config.status --file $@:$<
doxygen.hh: $(top_srcdir)/doxygen/doxygen.hh.in config.status
./config.status --file $@:$<
doxygen.conf: $(top_srcdir)/doxygen/doxygen.conf.in config.status
./config.status --file $@:$<
#
# Source distribution
#
DIST_FILES= \
configure.ac configure Makefile.in gecode.m4 \
changelog.in LICENSE \
doxygen/doxygen.conf.in doxygen/doxygen.hh.in \
install-sh \
misc/gecode.pc.in \
misc/gecode-search.pc.in misc/gecode-minimodel.pc.in \
misc/gecode-gist.pc.in misc/gecode-driver.pc.in \
gecode/support/config.hpp.in \
variables.vsl \
gecode/int/var-imp/int.vis \
gecode/int/var-imp/bool.vis \
gecode/set/var-imp/set.vis \
gecode/int/branch/post-view-int.bs \
gecode/int/branch/post-view-bool.bs \
gecode/set/branch/post-view.bs \
examples/support.hh \
examples/support/example.hpp \
examples/support/options.hpp \
misc/doxygen/back.png misc/doxygen/gecode-logo-100.png \
misc/doxygen/stylesheet.css misc/doxygen/footer.html \
misc/doxygen/header.html misc/genlicense.perl \
misc/genstatistics.perl misc/getrevision.perl \
misc/genchangelog.perl misc/genvarimp.perl \
misc/gentxtchangelog.perl misc/makedepend.perl \
misc/genbranch.perl
distdir:
rm -rf gecode-$(VERSION) && \
mkdir -p gecode-$(VERSION) && \
(cd $(top_srcdir) && tar cf - $(ALLHDR) $(ALLSRC)) | \
(cd gecode-$(VERSION) && tar xf -) && \
(cd $(top_srcdir) && tar cf - $(TESTSRC) $(TESTHDR) $(DIST_FILES)) | \
(cd gecode-$(VERSION) && tar xf -)
dist: distdir
tar chof - gecode-$(VERSION) | gzip -c >gecode-$(VERSION).tar.gz
rm -rf gecode-$(VERSION)
#
# Documentation
#
export ENABLEDOCCHM = no
export ENABLEDOCDOCSET = no
ENABLEDOCSEARCH = no
.PHONY: doc
DOCSRC_NOTGENERATED = \
misc/doxygen/back.png misc/doxygen/footer.html \
misc/doxygen/gecode-logo-100.png \
misc/doxygen/stylesheet.css \
misc/genlicense.perl misc/genstatistics.perl misc/getrevision.perl \
misc/genchangelog.perl
DOCSRC = $(DOCSRC_NOTGENERATED:%=$(top_srcdir)/%) \
doxygen.conf.use header.html \
doxygen.hh license.hh stat.hh changelog.hh
changelog.hh: $(top_srcdir)/changelog.in
perl $(top_srcdir)/misc/genchangelog.perl < $^ > changelog.hh
ChangeLog: $(top_srcdir)/changelog.in
perl $(top_srcdir)/misc/gentxtchangelog.perl < $^ > ChangeLog
license.hh: $(ALLHDR:%=$(top_srcdir)/%) $(ALLSRC:%=$(top_srcdir)/%) \
$(VARIMPHDR)
perl $(top_srcdir)/misc/genlicense.perl $^ > license.hh
stat.hh: $(ALLHDR:%=$(top_srcdir)/%) $(ALLSRC:%=$(top_srcdir)/%) \
$(TESTHDR:%=$(top_srcdir)/%) $(TESTSRC:%=$(top_srcdir)/%) \
$(VARIMPHDR)
perl $(top_srcdir)/misc/genstatistics.perl $^ > stat.hh
ifeq "no" "yes"
DOCTARGET=GecodeReference.chm
header.html: $(top_srcdir)/misc/doxygen/header.html doxygen.conf
grep -v '<form.*form>' < $< > $@
doxygen.conf.use: doxygen.conf
(echo "GENERATE_HTMLHELP = YES"; \
echo "SEARCHENGINE = NO";\
echo "HAVE_DOT = NO") | \
cat $< - > $@
doc: $(ALLHDR:%=$(top_srcdir)/%) $(VARIMPHDR) \
$(ALLSRC:%=$(top_srcdir)/%) $(DOCSRC)
mkdir -p doc/html
cp -f $(top_srcdir)/misc/doxygen/back.png \
$(top_srcdir)/misc/doxygen/gecode-logo-100.png doc/html
doxygen doxygen.conf.use
mv doc/html/GecodeReference.chm GecodeReference.chm
else
ifeq "no" "yes"
DOCTARGET=org.gecode.3.7.3.docset
header.html: $(top_srcdir)/misc/doxygen/header.html doxygen.conf
grep -v '<form.*form>' < $< > $@
doxygen.conf.use: doxygen.conf
(echo "SEARCHENGINE = NO";\
echo "HAVE_DOT = NO";\
echo "GENERATE_DOCSET = YES";\
echo "DOCSET_BUNDLE_ID = org.gecode.3.7.3";\
echo "DOCSET_FEEDNAME = Gecode") | \
cat $< - > $@
doc: $(ALLHDR:%=$(top_srcdir)/%) $(VARIMPHDR) $(ALLSRC:%=$(top_srcdir)/%) \
$(DOCSRC)
mkdir -p doc/html
cp -f $(top_srcdir)/misc/doxygen/back.png \
$(top_srcdir)/misc/doxygen/gecode-logo-100.png doc/html
doxygen doxygen.conf.use
cd doc/html && make
mv doc/html/$(DOCTARGET) .
else
DOCTARGET=doc/html
ifeq "no" "yes"
header.html: $(top_srcdir)/misc/doxygen/header.html doxygen.conf
cat < $< > $@
doxygen.conf.use: doxygen.conf
(echo "GENERATE_HTMLHELP = NO"; \
echo "SEARCHENGINE = YES"; \
echo "SERVER_BASED_SEARCH = YES"; \
echo "HAVE_DOT = NO") | \
cat $< - > $@
else
header.html: $(top_srcdir)/misc/doxygen/header.html doxygen.conf
grep -v '<form.*form>' < $< > $@
doxygen.conf.use: doxygen.conf
(echo "GENERATE_HTMLHELP = NO"; \
echo "SEARCHENGINE = NO"; \
echo "HAVE_DOT = NO") | \
cat $< - > $@
endif
doc: $(ALLHDR:%=$(top_srcdir)/%) $(VARIMPHDR) $(ALLSRC:%=$(top_srcdir)/%) \
$(DOCSRC)
mkdir -p doc/html
cp -f $(top_srcdir)/misc/doxygen/back.png \
$(top_srcdir)/misc/doxygen/gecode-logo-100.png doc/html
doxygen doxygen.conf.use
ifeq "no" "yes"
# Work around a doxygen bug (a missing div screws up the layout)
mv doc/html/search.php doc/html/search2.php
sed -e 's|<div class="qindex">|<div><div class="qindex">|' \
doc/html/search2.php > doc/html/search.php
rm doc/html/search2.php
endif
endif
endif
#
# Installation
#
.PHONY: install
ifeq "" "yes"
install: installframework
else
ifeq "no" "yes"
install: installlib installexamples
else
install: installlib
endif
endif
doinstallheaders: $(ALLHDR:%=$(top_srcdir)/%) $(EXTRA_HEADERS) $(VARIMPHDR)
mkdir -p $(DESTDIR)$(includedir) && \
(cd $(top_srcdir) && tar cf - $(ALLHDR)) | \
(cd $(DESTDIR)$(includedir) && tar xf -) && \
for_varimpheaders="$(VARIMPHDR)" && \
for f in $$for_varimpheaders; do \
cp $$f $(DESTDIR)$(includedir)/gecode/kernel; done && \
for_extraheaders="$(EXTRA_HEADERS)" && \
for f in $$for_extraheaders; do \
cp $$f $(DESTDIR)$(includedir)/gecode/support; done && \
for_mznlib="$(FLATZINCMZNLIB)" && \
for f in $$for_mznlib; do \
mkdir -p $(DESTDIR)$(datadir)/gecode/mznlib; \
cp $(top_srcdir)/$$f/*.mzn \
$(DESTDIR)$(datadir)/gecode/mznlib; done
doinstalllib:
mkdir -p $(DESTDIR)$(sharedlibdir) && \
mkdir -p $(DESTDIR)$(libdir) && \
mkdir -p $(DESTDIR)$(bindir) && \
for_libtargets="$(LIBTARGETS) $(PDBTARGETS)" && \
for f in $$for_libtargets; do \
cp $$f $(DESTDIR)$(sharedlibdir); done && \
for_liblinktargets="$(LIBLINKTARGETS)" && \
for f in $$for_liblinktargets; do \
cp -pR $$f $(DESTDIR)$(sharedlibdir); done &&\
for_liblibtargets="$(LIBLIBTARGETS)" && \
for f in $$for_liblibtargets; do \
cp $$f $(DESTDIR)$(libdir); done &&\
for_exetargets="$(EXETARGETS)" && \
for f in $$for_exetargets; do \
cp $$f $(DESTDIR)$(bindir); done
ifeq "yes" "yes"
ranliblib:
for_static="$(STATICTARGETS)" ; \
for f in $$for_static; do \
$(RANLIB) $(DESTDIR)$(sharedlibdir)/$$f; done
else
ranliblib:
endif
installlib: compilelib
$(MAKE) doinstalllib
$(MAKE) doinstallheaders
$(MAKE) ranliblib
$(MAKE) installsubdirs
installexamples: compileexamples
mkdir -p $(DESTDIR)$(bindir); \
for_exampleexe="$(EXAMPLEEXE)" ; \
for f in $$for_exampleexe; do cp $$f $(DESTDIR)$(bindir); done \
installframework: framework
mkdir -p $(DESTDIR)/Library/Frameworks/gecode.framework && \
(cd gecode.framework && tar cf - *) | \
(cd $(DESTDIR)/Library/Frameworks/gecode.framework && tar xf -)
installdoc: doc
mkdir -p $(DESTDIR)$(docdir); \
cp -r $(DOCTARGET) $(DESTDIR)$(docdir)
installsubdirs:
@for_subdirs="$(subdirs)" ; for i in $$for_subdirs; do \
cd $$i && if test -f Makefile; then \
echo "Making install in directory $$i"; \
$(MAKE) install; \
fi; \
done
#
# Source Distribution
#
.PHONY: distdoc
ifeq "no" "yes"
DOCSUFFIX = search-$(VERSION)
else
DOCSUFFIX = $(VERSION)
endif
distdoc: doc
rm -rf gecode-doc-$(DOCSUFFIX) && \
mv doc/html gecode-doc-$(DOCSUFFIX) && \
$(TAR) cf - gecode-doc-$(DOCSUFFIX) | \
gzip -9 > gecode-doc-$(DOCSUFFIX).tar.gz && \
7z a -mx9 gecode-doc-$(DOCSUFFIX).7z gecode-doc-$(DOCSUFFIX) && \
$(RMF) gecode-doc-$(DOCSUFFIX) && \
if test -f doc/gecode-doc.tag; then \
mv doc/gecode-doc.tag gecode-doc-$(DOCSUFFIX).tag && \
gzip -9 gecode-doc-$(DOCSUFFIX).tag; \
fi
#
# Maintenance targets
#
clean:
$(RMF) *.stackdump core gmon.out \
vc70.pdb vc80.pdb vc90.pdb vc100.pdb
$(RMF) doxygen.log doxygen.hh doxygen.conf.use stat.hh \
changelog.hh doxygen.hh license.hh header.html
$(RMF) $(ALLOBJ) $(ALLSBJ) $(ALLOBJ:%$(OBJSUFFIX)=%.pdb)
$(RMF) $(TESTOBJ) $(TESTSBJ) $(TESTOBJ:%$(OBJSUFFIX)=%.pdb)
$(RMF) $(GISTMOCSRC)
$(RMF) $(LIBTARGETS:%$(DLLSUFFIX)=%$(MANIFESTSUFFIX)) \
$(LIBTARGETS:%$(DLLSUFFIX)=%$(RCSUFFIX)) \
$(LIBTARGETS:%$(DLLSUFFIX)=%$(RESSUFFIX)) \
$(LIBTARGETS:%$(DLLSUFFIX)=%$(EXPSUFFIX))
$(RMF) $(EXAMPLEEXE:%.exe=%.pdb) $(EXAMPLEEXE:%=%.manifest) \
$(EXAMPLEEXE:%=%.rc) $(EXAMPLEEXE:%=%.res)
$(RMF) $(TESTEXE:%.exe=%.pdb) $(TESTEXE:%=%.manifest) \
$(TESTEXE:%=%.rc) $(TESTEXE:%=%.res)
$(RMF) $(FLATZINCEXE:%.exe=%.pdb) $(FLATZINCEXE:%=%.manifest) \
$(FLATZINCEXE:%=%.rc) $(FLATZINCEXE:%=%.res)
veryclean: clean
$(RMF) $(LIBTARGETS) \
$(LIBTARGETS:%$(DLLSUFFIX)=%$(LIBSUFFIX)) \
$(LIBTARGETS:%$(DLLSUFFIX)=%$(PDBSUFFIX))
$(RMF) $(LIBTARGETS:%$(DLLSUFFIX)=%$(SOLINKSUFFIX)) \
$(LIBTARGETS:%$(DLLSUFFIX)=%$(SOSUFFIX))
$(RMF) $(EXAMPLEEXE)
$(RMF) $(TESTEXE)
$(RMF) $(FLATZINCEXE)
$(RMF) doc GecodeReference.chm ChangeLog
$(RMF) $(ALLOBJ:%$(OBJSUFFIX)=%.gcno) $(TESTOBJ:%$(OBJSUFFIX)=%.gcno)
$(RMF) $(ALLOBJ:%$(OBJSUFFIX)=%.gcda) $(TESTOBJ:%$(OBJSUFFIX)=%.gcda)
distclean: veryclean
$(RMF) $(VARIMP)
$(RMF) $(GENBRANCHSRC)
$(RMF) Makefile doxygen.conf
$(RMF) $(EXTRA_HEADERS)
$(RMF) config.log config.status Makefile.dep
depend: mkcompiledirs
@$(MAKE) $(VARIMP) $(GENBRANCHSRC)
perl $(top_srcdir)/misc/makedepend.perl \
$(top_srcdir) \
$(ALLSRC) \
$(FLATZINC_GENSRC) \
$(TESTSRC) > Makefile.dep
-include Makefile.dep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment