From 4b651dbe1f958eecbabb2d7e208c7bf837085409 Mon Sep 17 00:00:00 2001 From: q-posev Date: Tue, 20 Jul 2021 14:57:48 +0200 Subject: [PATCH] better make for Python --- Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index d4f7b44..c7b2f1e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -180,7 +180,13 @@ cppcheck.out: $(trexio_h) -I../include *.c *.h 2>../$@ -python: $(ORG_FILES) $(trexio_h) src/pytrexio.i +python: src/_pytrexio.so + +python-test: src/test.py src/_pytrexio.so + cd src/ && python3 test.py + $(RM) -r -- src/__pycache__ + +src/_pytrexio.so: $(ORG_FILES) $(trexio_h) src/pytrexio.i cp $(trexio_h) src/ cd src/ && \ swig -python -o pytrexio_wrap.c pytrexio.i && \ @@ -188,10 +194,12 @@ python: $(ORG_FILES) $(trexio_h) src/pytrexio.i -c trexio.c trexio_hdf5.c trexio_text.c pytrexio_wrap.c && \ $(CC) -shared trexio.o trexio_hdf5.o trexio_text.o pytrexio_wrap.o \ $(LDFLAGS) $(LIBS) -o _pytrexio.so - rm -f -- src/trexio.h + $(RM) -- src/trexio.h -.PHONY: cppcheck +CLEANFILES += src/pytrexio_wrap.c src/pytrexio.py src/_pytrexio.so + +.PHONY: cppcheck python python-test endif