diff options
| author | Gus Smith <gus@normalcomputing.ai> | 2026-05-29 10:33:07 -0700 |
|---|---|---|
| committer | Gus Smith <gus@normalcomputing.ai> | 2026-05-29 10:33:07 -0700 |
| commit | ec9d9e6e7fbe7623d27069789a6a0380a2feb1c2 (patch) | |
| tree | 915b8218d1b21ffecce8dbef9a640c74717e6081 | |
| parent | ac29b5a73986bf6c9413751078c9a234842bcbe4 (diff) | |
| download | dram-bender-ec9d9e6e7fbe7623d27069789a6a0380a2feb1c2.tar.gz | |
Undo some changes we're no longer using
| -rw-r--r-- | sources/api/pySoftMC/Makefile | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sources/api/pySoftMC/Makefile b/sources/api/pySoftMC/Makefile index f7620f4..76f8f6e 100644 --- a/sources/api/pySoftMC/Makefile +++ b/sources/api/pySoftMC/Makefile @@ -1,19 +1,23 @@ +# https://stackoverflow.com/questions/4933285/how-to-determine-python-version-in-makefile +python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python3 --version 2>&1))) +python_version := $(word 1,${python_version_full}).$(word 2,${python_version_full}) + program_NAME := pySoftMC program_CXX_SRCS := $(wildcard ../*.c) $(wildcard ../*.cpp) ./pySoftMC.cpp program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o} program_CXX_OBJS := ${program_CXX_OBJS:.c=.o} program_OBJS := $(program_CXX_OBJS) -PYTHON_INCLUDES ?= $(shell python3-config --includes) -PYTHON_LDFLAGS ?= $(shell python3-config --ldflags --embed 2>/dev/null || python3-config --ldflags) -PYTHON_EXT_SUFFIX ?= $(PYTHON_EXT_SUFFIX) -program_INCLUDE_DIRS := . .. ../ext/pybind11/include +program_INCLUDE_DIRS := . .. /usr/include/python${python_version} ../ext/pybind11/include +program_LIBRARY_DIRS := +program_LIBRARIES := python${python_version} CPPFLAGS += -g -std=c++14 -pthread -O3 -fPIC -Wall -CPPFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir)) $(PYTHON_INCLUDES) -DPYSMC -LDFLAGS += $(PYTHON_LDFLAGS) +CPPFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir)) -DPYSMC +LDFLAGS += $(foreach librarydir,$(program_LIBRARY_DIRS),-L$(librarydir)) +LDFLAGS += $(foreach library,$(program_LIBRARIES),-l$(library)) -SHARED_LIB_FLAGS := -shared -fPIC +SHARED_LIB_FLAGS := -shared -fPIC CC=g++ @@ -23,10 +27,10 @@ all: $(program_NAME) @- $(RM) $(program_OBJS) $(program_NAME): $(program_OBJS) - $(CC) $(CPPFLAGS) ${SHARED_LIB_FLAGS} $(program_OBJS) -o $(program_NAME)$(PYTHON_EXT_SUFFIX) $(LDFLAGS) + $(CC) $(CPPFLAGS) ${SHARED_LIB_FLAGS} $(program_OBJS) -o $(program_NAME)$(shell python3-config --extension-suffix) $(LDFLAGS) clean: - @- $(RM) $(program_NAME)$(PYTHON_EXT_SUFFIX) + @- $(RM) $(program_NAME)$(shell python3-config --extension-suffix) @- $(RM) $(program_OBJS) distclean: clean |
