Improved intermediate *.c generation
This commit is contained in:
parent
17fdb7bed0
commit
4486026d23
17
src/Makefile
17
src/Makefile
|
@ -19,8 +19,9 @@
|
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
||||
#=----------------------------------------------------------------------------=#
|
||||
|
||||
.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
|
||||
|
|
Loading…
Reference in New Issue