Makefile at toplevel
This commit is contained in:
parent
f35f7659a0
commit
6540aeadd2
|
@ -19,40 +19,40 @@
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
||||||
#=----------------------------------------------------------------------------=#
|
#=----------------------------------------------------------------------------=#
|
||||||
|
|
||||||
.DEFAULT_GOAL:= all
|
|
||||||
.PHONY: all clean
|
|
||||||
.PRECIOUS: %.c
|
|
||||||
|
|
||||||
CCOPTS=-pthread -fPIC -fwrapv -Wall -fno-strict-aliasing
|
CCOPTS=-pthread -fPIC -fwrapv -Wall -fno-strict-aliasing
|
||||||
CCFLAGS=-I /usr/include/python3.9
|
CCFLAGS=-I /usr/include/python3.9
|
||||||
LDFLAGS=-lpython3.9 -lpthread -lm -lutil -ldl
|
LDFLAGS=-lpython3.9 -lpthread -lm -lutil -ldl
|
||||||
BINDIR=../bin
|
BINDIR=bin
|
||||||
|
SRCDIR=src
|
||||||
DYNLIBS= $(BINDIR)/scheduler.so $(BINDIR)/server.so $(BINDIR)/localthread.so
|
DYNLIBS= $(BINDIR)/scheduler.so $(BINDIR)/server.so $(BINDIR)/localthread.so
|
||||||
|
|
||||||
|
.DEFAULT_GOAL:= all
|
||||||
|
.PHONY: all clean
|
||||||
|
.PRECIOUS: $(SRCDIR)/%.c
|
||||||
|
|
||||||
# ---- General recipes ------------------------------------------------------- #
|
# ---- General recipes ------------------------------------------------------- #
|
||||||
|
|
||||||
$(BINDIR)/%.so: %.c
|
$(BINDIR)/%.so: $(SRCDIR)/%.c
|
||||||
@echo "Building dynamic library $@"
|
@echo "Building dynamic library $@"
|
||||||
@$(CC) --shared $(CCOPTS) $(CCFLAGS) -o $@ $<
|
@$(CC) --shared $(CCOPTS) $(CCFLAGS) -o $@ $<
|
||||||
|
|
||||||
%.c: %.py
|
$(SRCDIR)/%.c: $(SRCDIR)/%.py
|
||||||
@echo "Cythonizing $< to $@"
|
@echo "Cythonizing $< to $@"
|
||||||
@cython3 -3 $< -o $@
|
@cython3 -3 $< -o $@
|
||||||
|
|
||||||
# ---- Main recipe ----------------------------------------------------------- #
|
# ---- Main recipe ----------------------------------------------------------- #
|
||||||
$(BINDIR)/gem-graph-server: main.c
|
$(BINDIR)/gem-graph-server: $(SRCDIR)/main.c
|
||||||
@echo "Building program to $@"
|
@echo "Building program to $@"
|
||||||
@$(CC) $(CCOPTS) -no-pie $(CCFLAGS) -o $@ $< $(LDFLAGS)
|
@$(CC) $(CCOPTS) -no-pie $(CCFLAGS) -o $@ $< $(LDFLAGS)
|
||||||
@echo "Success!"
|
@echo "Success!"
|
||||||
|
|
||||||
main.c: main.py
|
$(SRCDIR)/main.c: $(SRCDIR)/main.py
|
||||||
@echo "Cythonizing main file to $@"
|
@echo "Cythonizing main file to $@"
|
||||||
@cython3 -3 $< -o $@ --embed
|
@cython3 -3 $< -o $@ --embed
|
||||||
|
|
||||||
|
|
||||||
# ---- Misc recipes ---------------------------------------------------------- #
|
# ---- Misc recipes ---------------------------------------------------------- #
|
||||||
clean:
|
clean:
|
||||||
rm -rf *.c ../bin/*
|
rm -rf $(SRCDIR)/*.c $(BINDIR)/*
|
||||||
|
|
||||||
all: $(DYNLIBS) $(BINDIR)/gem-graph-server
|
all: $(DYNLIBS) $(BINDIR)/gem-graph-server
|
Loading…
Reference in New Issue