-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmakefile.optimizer
More file actions
executable file
·140 lines (116 loc) · 3.37 KB
/
Copy pathmakefile.optimizer
File metadata and controls
executable file
·140 lines (116 loc) · 3.37 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#This file is part of SECONDO.
#
#Copyright (C) 2004, University in Hagen, Department of Computer Science,
#Database Systems for New Applications.
#
#SECONDO 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 2 of the License, or
#(at your option) any later version.
#
#SECONDO 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 SECONDO; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Check if Prolog variables are set and define macros used for
# compilation of the optimizer.
ifneq ($(OptMsg),"true")
ifeq ($(platform),win32)
ifndef SWI_HOME_DIR
$(warning Variable SWI_HOME_DIR not defined. If you want to use the optimizer you have to set it up!)
endif
endif
ifdef PL_INCLUDE_DIR
ifdef PL_LIB_DIR
optimizer := "true"
else
$(warning Variable PL_LIB_DIR not defined. If you want to use the optimizer you have to set it up!)
endif
else
$(warning Variable PL_INCLUDE_DIR not defined. If you want to use the optimizer you have to set it up!)
endif
ifndef PL_LIB
ifeq ($(platform),mac_osx)
PL_LIB = swipl
else
PL_LIB = pl
endif
endif
export PL_LIB_DIR PL_INCLUDE_DIR PL_LIB optimizer
export OptMsg := "true"
endif
ifeq ($(optimizer),"true")
OPTIMIZER_SERVER := optserver
AUXLIBS := $(SECONDO_SDK)/auxtools/lib
STDPLLDFLAGS := -L$(PL_LIB_DIR) -l$(PL_LIB)
ifdef STATIC_PL_LIB
STDPLLDFLAGS := $(STATIC_PL_LIB)
endif
# compilation options for the PROLOG shell
ifeq ($(platform),win32)
PLLDFLAGS := $(STDPLLDFLAGS) -lm
endif
platform2 := $(subst 64,,$(platform))
ifeq ($(platform2),linux)
ifndef GMP_LIB
PLVER := $(shell if [ $(PL_VERSION) -lt 50600 ]; then echo "5x"; else echo "6x"; fi)
ifeq ($(PLVER), 6x)
LD_GMP := -lgmpxx -lgmp
endif
else
LD_GMP := -l$(GMP_LIB)
endif
PLLDFLAGS := $(STDPLLDFLAGS) -lreadline -lncurses -lm -L$(AUXLIBS) $(LD_GMP)
endif
ifndef LIBREADLINE
LIBREADLINE=$(AUXLIBS)/libreadline.a
endif
ifeq ($(platform),mac_osx)
ifdef SECONDO_READLINE_DIR
MAC_READLINE := -L$(SECONDO_READLINE_DIR)/lib -lreadline
else
MAC_READLINE := -lreadline
endif
PLLDFLAGS := $(STDPLLDFLAGS) $(MAC_READLINE) -lncurses -lm
endif
PLLDFLAGS += -loptparser
# define directories for using jpl
ifndef PL_VERSION
JPLVER=10
else
ifeq ($(shell test $(PL_VERSION) -lt 50200; echo $$?),0)
JPLVER=10
endif
ifeq ($(shell test $(PL_VERSION) -lt 70000; echo $$?),0)
JPLVER=30
endif
ifeq ($(shell test $(PL_VERSION) -lt 80200; echo $$?),0)
JPLVER=70
endif
ifeq ($(shell test $(PL_VERSION) -ge 80200; echo $$?),0)
JPLVER=82
endif
endif
ifeq ($(JPLVER),10)
JPL_HEADER=jpl_fli_Prolog.h
else
JPL_HEADER=jpl.h
endif
JPL_ROOT := $(BUILDDIR)/Jpl
JPL_LIB := $(JPL_ROOT)/lib
JPL_CLASS_TARGET := $(JPL_LIB)/classes
JPL_JAVA_SOURCES := $(JPL_ROOT)/jsrc/$(JPLVER)
JPL_DOC_TARGET := $(JPL_ROOT)/doc
JPL_CLASSPATH := .:$(JPL_CLASS_TARGET)
ifdef SECONDO_JAVART
JPL_CLASSPATH := $(JPL_CLASSPATH):$(SECONDO_JAVART)
endif
JPL_SRC := $(JPL_ROOT)/src
# directory which contains SecondoPl.o
SECONDOPL_DIR := $(BUILDDIR)/UserInterfaces
endif