diff --git a/.gitignore b/.gitignore index bee8a64..bf9deb4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ __pycache__ +wp-cal-integration +*.c +*.o diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..69908fa --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +CC ?= cc +CFLAGS ?= $(shell python-config --embed --cflags) +LDFLAGS ?= $(shell python-config --embed --ldflags) + +SRC := main.py adapters/*.py +OBJ := $(SRC:%.py=%.o) + +wp-cal-integration: $(OBJ) + $(CC) $(LDFLAGS) -o $@ $^ + +clean: + $(RM) $(OBJ) + +main.c: main.py + cython -3 --embed -o $@ $< +%.c: %.py + cython -3 -o $@ $< + +%.o: %.c + $(CC) -c $(CFLAGS) -o $@ $< +