File: rules

package info (click to toggle)
gringo 4.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,260 kB
  • ctags: 10,755
  • sloc: cpp: 55,049; python: 629; yacc: 569; sh: 124; makefile: 23
file content (55 lines) | stat: -rwxr-xr-x 1,821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# compile with libtbb-dev only with linux 64bit intel/ppc architectures,
# fallback in pentium4 processors is not implemented, see also note of
# libtbb-dev:
#
# Note: if you are a user of the i386 architecture, i.e., 32-bit Intel
# or compatible hardware, this package only supports Pentium4-compatible
# and higher processors.
#
arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH | egrep "(amd64|ia64|ppc64)")
os = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS | grep linux)

# force g++, lua5.2, and python2.7
CONFIGPARMS = CXX='g++' WITH_LUA='lua5.2' WITH_PYTHON='python2.7' CPPPATH='$${["/usr/include/lua5.2","/usr/include/python2.7"]}'
ifeq ($(and $(if $(os),good), $(if $(arch),good)), good)
	CONFIGPARMS += WITH_TBB="tbb"
endif

#
# export CPPFLAGS, CXXFLAGS, and LDFLAGS for scons
#
# default to -O3 -std=c++11 -Wall -DNDEBUG and enable all hardening flags
#
DEB_CXXFLAGS_MAINT_APPEND = -std=c++11 -O3 -Wall
DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# inject compiler and linker flags to scons variables
SCCXXFLAGS =  $(shell echo $(CXXFLAGS) $(CPPFLAGS) | sed -e 's/^/\$${["/;s/ -/","-/g;s/$$/"]}/')
SCLINKFLAGS = $(shell echo $(LDFLAGS) | sed -e 's/^/\$${["/;s/ -/","-/g;s/$$/"]}/')

%:
	dh $@

# configure with LUA, Python, and possibly TBB
override_dh_auto_configure:
	scons configure --build-dir=release $(CONFIGPARMS) CXXFLAGS='$(SCCXXFLAGS)' LINKFLAGS='$(SCLINKFLAGS)'

# build gringo and clingo
override_dh_auto_build:
	scons --build-dir=release gringo clingo

override_dh_auto_clean:
	rm -rf ./build .sconf_temp .sconsign.dblite

override_dh_installchangelogs:
	dh_installchangelogs CHANGES