22 lines
632 B
Makefile
22 lines
632 B
Makefile
|
CFLAGS:=`pkg-config --cflags guile-3.0 agar` -I./include/
|
||
|
LDLIBS:=`pkg-config --libs guile-3.0 agar`
|
||
|
SRCS:=$(wildcard src/*.c)
|
||
|
OBJS:=$(SRCS:.c=.o)
|
||
|
SCMS:=$(patsubst src/%.o,scm/agar/%.scm,$(OBJS))
|
||
|
OBJS+=$(patsubst scm/agar/%.scm,scm/agar_%_wrap.o,$(SCMS))
|
||
|
|
||
|
.PHONY: driver
|
||
|
all: libguileagar.so $(SCMS)
|
||
|
|
||
|
clean:
|
||
|
rm -rf libguileagar.so $(SCMS) $(OBJS) $(WRAPS)
|
||
|
|
||
|
libguileagar.so: $(OBJS)
|
||
|
$(CC) -shared -fPIC -o $@ $^ $(LDLIBS)
|
||
|
|
||
|
scm/agar/%.scm scm/agar_%_wrap.c: scm/%.i include/%.h
|
||
|
swig -I./include -guile -Linkage module -scmstub -package agar -o scm/agar_$*_wrap.c scm/$*.i
|
||
|
|
||
|
driver:
|
||
|
GUILE_EXTENSIONS_PATH=. guile -L scm driver.scm
|