source: orange/source/makefile.defs @ 8984:bf2c7d6854e4

Revision 8984:bf2c7d6854e4, 3.0 KB checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)

Added STATICCOMPILEOPTIONS define to makefile.defs for use in include/Makefile.
Fixes #950.

Line 
1# Line below determines the directory with Python.h.
2# If this does not work, find Python.h yourself and enter
3# the directory below.
4PYTHONINCLUDE = $(shell $(PYTHON) -c "import sys; print sys.prefix+'/include/python'+sys.version[:3]")
5PYTHONLIB = $(shell $(PYTHON) -c "import sys; print sys.prefix+'/lib/python'+sys.version[:3]")
6PYTHONSITEPKGS = $(PYTHONLIB)/site-packages
7PYTHONVER = $(shell $(PYTHON) -c "import sys; print sys.version[:3]")
8
9
10DESTDIR = $(PYTHONSITEPKGS)/orange
11DOCDIR = /usr/local/doc/orange
12SCRIPTDIR = /usr/local/bin
13INSTALL = install
14INSTALL_DATA = $(INSTALL) -m 644
15INSTALL_SCRIPT = $(INSTALL)
16INSTALL_SHARED = $(INSTALL) -m 555
17INSTALL_DIR = $(INSTALL) -d -m 755
18
19OS = $(shell uname)
20MAKE = make
21#COMPILER = /opt/intel/cc/10.1.015/bin/icc
22#CCOMPILER = /opt/intel/cc/10.1.015/bin/icc
23COMPILER = g++
24CCOMPILER = gcc
25#LINKER = /opt/intel/cc/10.1.015/bin/icc
26LINKER = gcc
27LIBRARY_FILE = liborange.so
28
29NUMPY_INCLUDE = $(shell $(PYTHON) -c "import numpy; print numpy.get_include();")
30
31ifeq ($(OS), Darwin)
32  ifeq ($(PYTHONVER), 2.7)
33    export MACOSX_DEPLOYMENT_TARGET = $(shell $(PYTHON) -c "import sysconfig; print sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')")
34  else
35    export MACOSX_DEPLOYMENT_TARGET = 10.4
36  endif
37  COMPILEOPTIONS = -fPIC -fpermissive -fno-common -w -DDARWIN -D$(MODULENAME)_EXPORTS -O3 -I$(NUMPY_INCLUDE) $(CXXFLAGS)
38  STATICCOMPILEOPTIONS = -fpermissive -fno-common -w -DDARWIN -D$(MODULENAME)_EXPORTS -O3 -I$(NUMPY_INCLUDE) $(CXXFLAGS)
39  LINKOPTIONS = -dynamiclib -headerpad_max_install_names -undefined dynamic_lookup -lstdc++ -L$(OLD) -lorange_include $(LDFLAGS)
40  LINKER = g++
41else
42ifeq ($(OS), FreeBSD)
43  COMPILEOPTIONS = -fPIC -fpermissive -w -DFREEBSD -O3 $(CXXFLAGS)
44  STATICCOMPILEOPTIONS = -fpermissive -w -DFREEBSD -O3 $(CXXFLAGS)
45  LINKOPTIONS = -shared -lstdc++ -L$(OLD) -lorange_include $(LDFLAGS)
46  LINKOPTIONS += `gsl-config --libs`
47  MAKE = gmake
48else
49  # for icc, also add -D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"
50  COMPILEOPTIONS = -fPIC -fpermissive -w -DLINUX -D$(MODULENAME)_EXPORTS -O3 $(CXXFLAGS)
51  STATICCOMPILEOPTIONS = -fpermissive -w -DLINUX -D$(MODULENAME)_EXPORTS -O3 $(CXXFLAGS) # To make Debian package managers happy
52  LINKOPTIONS = -Wl,-R'$$ORIGIN' -shared -lstdc++ -L$(OLD) -lorange_include $(LDFLAGS)
53endif
54endif
55
56ifneq ($(MODULENAME), ORANGE)
57  LINKOPTIONS += -lorange
58endif
59
60vpath %.cpp ../include
61vpath %.hpp ../include
62vpath %.px px
63vpath %.ppp ppp
64vpath %.h orange:include:$(PYTHONINCLUDE):/usr/local/include/gsl:/usr/include/gsl
65
66obj/%.o : %.cpp
67    $(COMPILER) $(COMPILEOPTIONS) -c $< -o $@
68
69
70export CPATH=ppp:px:../include:../orange:$(PYTHONINCLUDE):/usr/local/include:/usr/include:$(PYTHONSITEPKGS)/numpy/core/include
71
72makefile.deps:
73    PYTHON=$(PYTHON) $(PYTHON) ../pyxtract/makedep.py -n $(MODULENAME)
74    rm -f ppp/stamp
75    rm -f px/stamp
76
77objdir:
78    -@mkdir -p obj > /dev/null
79
80cleantemp:
81    rm -rf obj ppp px makefile.deps ../pyxtract/*.pyc ./pyxtract/*.pyc
Note: See TracBrowser for help on using the repository browser.