Skip to content

Commit

Permalink
Merge pull request #245 from danbeibei/fix_meson_build_example
Browse files Browse the repository at this point in the history
Update custom rule for meson makefile, fix #244
  • Loading branch information
jameskermode authored Jan 7, 2025
2 parents 69b61af + 18f8f16 commit f3f5d0f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/string_array_input_f2py/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ F2PY = f2py
LINK = -lgfortran
.PHONY: all clean

all: f2py test
all: test

clean:
rm -rf *.mod *.smod *.o f90wrap*.f90 ${PY_MOD}_*.py _${PY_MOD}*.so __pycache__/ .f2py_f2cmap build ${PY_MOD}_*/ ${SIGNATURES}
Expand Down
30 changes: 24 additions & 6 deletions examples/string_array_input_f2py/Makefile.meson
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
include ../make.meson.inc

NAME := pywrapper_no_sign
NAME := pywrapper_sign
NAME2 := pywrapper_no_sign
MAKEFILE := $(lastword $(MAKEFILE_LIST))
SIGNATURES = _signatures.pyf
F2PY = f2py

test: build
echo "TODO: Fix meson build for tests without signatures"
# $(PYTHON) tests_no_sign.py
echo "TODO: Add tests_sign.py once meson build support signatures"
# $(PYTHON) tests_sign.py
test: extension
${PYTHON} tests_sign.py
${PYTHON} tests_no_sign.py

${SIGNATURES}: ${LIBSRC_WRAP_FILES}
${F2PY} ${LIBSRC_WRAP_FILES} -m _${NAME} -h ${SIGNATURES}

extension: ${SIGNATURES}
${F2PY} -c -m _${NAME} ${LIBSRC_WRAP_FILES} ${SIGNATURES}
${F2PY} -c -m _${NAME2} ${LIBSRC_WRAP_FILES}


clean:
-rm -f f90wrap_*.f90 *.o *.mod *.fpp *.a
-rm -rf src.*/ .f2py_f2cmap .libs/ __pycache__/
-rm -rf _${NAME}* ${NAME}*/ ${NAME}.py
-rm -rf _build_dir
-rm -f meson.build*
-rm -f ${SIGNATURES}

0 comments on commit f3f5d0f

Please sign in to comment.