From d629e8fb710cdc4fdcdf81c0c686f691eaa29ad1 Mon Sep 17 00:00:00 2001 From: redxef Date: Wed, 23 Nov 2022 02:00:36 +0100 Subject: [PATCH] Add initial cython makefile. --- .gitignore | 3 +++ Makefile | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Makefile 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 $@ $< +