From 4486026d23b9ec2455191046ccb6a5ae8236e02d Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sat, 10 Apr 2021 23:02:40 +0200 Subject: [PATCH] Improved intermediate *.c generation --- src/Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Makefile b/src/Makefile index 367bb8b..7be3922 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,8 +19,9 @@ # along with this program. If not, see . # #=----------------------------------------------------------------------------=# -.PHONY: all clean -.DEFAULT_GOAL: all +.DEFAULT_GOAL:= all +.PHONY: all dynlibs clean +.PRECIOUS: %.c CCOPTS=-pthread -fPIC -fwrapv -Wall -fno-strict-aliasing CCFLAGS=-I /usr/include/python3.9 @@ -35,23 +36,25 @@ $(BINDIR)/%.so: %.c @echo "Building dynamic library $@" @$(CC) --shared $(CCOPTS) $(CCFLAGS) -o $@ $< -%.c: %.py +%.c: %.py @echo "Cythonizing $< to $@" - @cython3 $< -o $@ + @cython3 -3 $< -o $@ + +dynlibs: $(DYNLIBS) # ---- Main recipe ----------------------------------------------------------- # -$(BINDIR)/gem-graph-server: main.c $(DYNLIBS) +$(BINDIR)/gem-graph-server: main.c @echo "Building program to $@" @$(CC) $(CCOPTS) -no-pie $(CCFLAGS) -o $@ $< $(LDFLAGS) @echo "Success!" main.c: main.py @echo "Cythonizing main file to $@" - @cython3 $< -o $@ --embed + @cython3 -3 $< -o $@ --embed # ---- Misc recipes ---------------------------------------------------------- # clean: rm -rf *.c ../bin/* -all: $(BINDIR)/gem-graph-server +all: dynlibs $(BINDIR)/gem-graph-server