mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 03:01:36 +01:00
embedding python move from python-cheat
This commit is contained in:
34
userland/libs/python_embed/Makefile
Normal file
34
userland/libs/python_embed/Makefile
Normal file
@@ -0,0 +1,34 @@
|
||||
.POSIX:
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CFLGS = -std=c99
|
||||
CCFLGS = -ggdb3 -O0 -pedantic-errors -Wall -Wextra
|
||||
CXXFLGS = -std=c++11
|
||||
IN_EXT = .c
|
||||
IN_CXX_EXT = .cpp
|
||||
OUT_EXT = .out
|
||||
|
||||
OUTS = $(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT))) $(basename $(wildcard *$(IN_CXX_EXT))))
|
||||
|
||||
.PHONY: all clean test
|
||||
|
||||
all: $(OUTS)
|
||||
|
||||
%$(OUT_EXT): %$(IN_EXT)
|
||||
$(CC) $(CFLGS) $(CCFLGS) $$(pkg-config --cflags python3) -o '$@' '$<' $$(pkg-config --libs python3)
|
||||
|
||||
%$(OUT_EXT): %$(IN_CXX_EXT)
|
||||
$(CXX) $(CXXFLGS) $(CCFLGS) $$(pkg-config --cflags python3) -o '$@' '$<' $$(pkg-config --libs python3)
|
||||
|
||||
clean:
|
||||
rm -rf *'$(OUT_EXT)' __pycache__ *.pyc
|
||||
|
||||
test: all
|
||||
@\
|
||||
for t in *"$(OUT_EXT)"; do\
|
||||
if ! ./"$$t"; then\
|
||||
echo "ASSERT FAILED: $$t";\
|
||||
exit 1;\
|
||||
fi;\
|
||||
done;\
|
||||
Reference in New Issue
Block a user