Skip to content
Snippets Groups Projects
Commit ea6eaccf authored by dgelessus's avatar dgelessus
Browse files

Prepare building on non-Linux systems and respect SICSTUSDIR

parent bd0a2109
No related branches found
No related tags found
No related merge requests found
include src/common.mk
methods := \
adaboost \
approx_kfn \
......@@ -56,4 +58,4 @@ clean: clean_helper $(clean_methods)
.PHONY: test
test: methods
sicstus -l test_all.pl --goal "run_tests, halt ; halt(1)."
$(sicstus) -l test_all.pl --goal "run_tests, halt ; halt(1)."
splfr=/usr/local/sicstus4.7.1/bin/splfr
# by default, the target system is the same as the compiling system
TARGET_SYSTEM := $(shell uname -s)
# Under MinGW, Cygwin, MSYS2, etc. on Windows,
# uname -s has the format "<name>_NT-<version>",
# e. g. "MINGW64_NT-10.0-19044" or "CYGWIN_NT-10.0".
# To simplify checking for Windows,
# we detect this format and replace it with simply "Windows".
ifneq ($(findstring NT-,$(TARGET_SYSTEM)),)
TARGET_SYSTEM := Windows
endif
ifeq ($(TARGET_SYSTEM),Windows)
lib_ext := dll
foreign_ext := dll
bin_suffix := .exe
else
# If not Windows, assume Unix-like.
ifeq ($(TARGET_SYSTEM),Darwin)
lib_ext := dylib
foreign_ext := bundle
else
lib_ext := so
foreign_ext := so
endif
bin_suffix :=
endif
ifdef SICSTUSDIR
sicstus = $(SICSTUSDIR)/bin/sicstus$(bin_suffix)
splfr = $(SICSTUSDIR)/bin/splfr$(bin_suffix)
else
sicstus := sicstus
splfr := splfr
endif
common_splfr_flags := -larmadillo -fopenmp -lmlpack -lstdc++ -cxx --struct
......@@ -2,7 +2,7 @@ include ../common.mk
METHOD_NAME=helper_tests
$(METHOD_NAME).so: $(METHOD_NAME).pl $(METHOD_NAME).cpp
$(METHOD_NAME).$(foreign_ext): $(METHOD_NAME).pl $(METHOD_NAME).cpp
$(splfr) $(common_splfr_flags) $(CXXFLAGS) $(LDFLAGS) $(METHOD_NAME).pl $(METHOD_NAME).cpp helper.cpp $(LDLIBS)
clean:
rm $(METHOD_NAME).so
$(RM) $(METHOD_NAME).bundle $(METHOD_NAME).dll $(METHOD_NAME).so
......@@ -5,7 +5,7 @@
# which is one directory below this one.
include ../../common.mk
$(METHOD_NAME).so: $(METHOD_NAME).pl $(METHOD_NAME).cpp
$(splfr) $(common_splfr_flags) $(METHOD_NAME).pl $(METHOD_NAME).cpp ../../helper_files/helper.cpp
$(METHOD_NAME).$(foreign_ext): $(METHOD_NAME).pl $(METHOD_NAME).cpp
$(splfr) $(common_splfr_flags) $(CXXFLAGS) $(LDFLAGS) $(METHOD_NAME).pl $(METHOD_NAME).cpp ../../helper_files/helper.cpp $(LDLIBS)
clean:
rm $(METHOD_NAME).so
$(RM) $(METHOD_NAME).bundle $(METHOD_NAME).dll $(METHOD_NAME).so
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment