Add initial cython makefile.

This commit is contained in:
redxef 2022-11-23 02:00:36 +01:00
parent 605abaf177
commit d629e8fb71
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921
2 changed files with 24 additions and 0 deletions

3
.gitignore vendored
View file

@ -1 +1,4 @@
__pycache__
wp-cal-integration
*.c
*.o

21
Makefile Normal file
View file

@ -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 $@ $<