python_embed: use correct flags with python3-config --embed

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-05-14 01:00:00 +00:00
parent f17e68a109
commit ecb867e5fb

View File

@@ -3,7 +3,7 @@
CC = gcc
CXX = g++
CFLGS = -std=c99
CCFLGS = -ggdb3 -O0 -pedantic-errors -Wall -Wextra -Wno-missing-field-initializers
CCFLGS = -ggdb3 -O0 -pedantic-errors -Wall -Wextra -Wno-missing-field-initializers -fpie
CXXFLGS = -std=c++11
IN_EXT = .c
IN_CXX_EXT = .cpp
@@ -16,10 +16,10 @@ OUTS = $(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT))) $(basename $(w
all: $(OUTS)
%$(OUT_EXT): %$(IN_EXT)
$(CC) $(CFLGS) $(CCFLGS) $$(pkg-config --cflags python3) -o '$@' '$<' $$(pkg-config --libs python3)
$(CC) $(CFLGS) $(CCFLGS) $$(python3-config --cflags --embed) -o '$@' '$<' $$(python3-config --embed --ldflags)
%$(OUT_EXT): %$(IN_CXX_EXT)
$(CXX) $(CXXFLGS) $(CCFLGS) $$(pkg-config --cflags python3) -o '$@' '$<' $$(pkg-config --libs python3)
$(CXX) $(CXXFLGS) $(CCFLGS) $$(python3-config --cflags --embed) -o '$@' '$<' $$(python3-config --embed --ldflags)
clean:
rm -rf *'$(OUT_EXT)' __pycache__ *.pyc