https://github.com/SModelS/smodels
Raw File
Tip revision: fda91864483f39086fa4bbc11a4717325560282d authored by Wolfgang Waltenberger on 09 November 2020, 18:33:00 UTC
0.338
Tip revision: fda9186
Makefile
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python3 --version 2>&1)))
python_version_major := $(word 1,${python_version_full})
python_version_minor := $(word 2,${python_version_full})
libpython := -lpython$(python_version_major).$(python_version_minor)
LDFLAGS := $(shell python3-config --ldflags)
#LIBDIR := $(shell python3-config --prefix)
CFLAGS := $(shell python3-config --cflags)
#EXECPATH := $(shell python3-config --exec-prefix)/lib/python$(python_version_major).$(python_version_minor)

# GCC=g++

all: library executable

clean:
	rm -rf run libSModelS.so

library:
	$(CXX) SModelS.cc -I. $(CFLAGS) $(LDFLAGS) $(libpython) -shared -fPIC -o libSModelS.so

executable:
	@echo "run.cpp is meant as an example, tweak the code and integrate it in your framework!"
	$(CXX) run.cpp -I. -Wl,-rpath,`pwd` -L. -o run -ldl -lpthread -lutil -l SModelS
	@echo "done. now adapt parameters.ini and execute ./run"

run: .PHONY
	./run

.PHONY:
back to top