diff options
author | Mattias Andrée <maandree@kth.se> | 2016-08-16 11:53:49 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-08-16 11:53:49 +0200 |
commit | a8cede88dc170cf39f430e44fd9d659d3173032b (patch) | |
tree | d3e905e8b2c8a6cdfca8769f0262c0e1af812830 /Makefile | |
parent | Corrections to libcoopgamma_native.pyx.gpp (diff) | |
download | pylibcoopgamma-a8cede88dc170cf39f430e44fd9d659d3173032b.tar.gz pylibcoopgamma-a8cede88dc170cf39f430e44fd9d659d3173032b.tar.bz2 pylibcoopgamma-a8cede88dc170cf39f430e44fd9d659d3173032b.tar.xz |
...
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -1,7 +1,17 @@ GPP = gpp CYTHON = cython +PKGCONFIG = pkg-config -all: obj/libcoopgamma_native.c +PY_MAJOR = 3 + +OPTIMISE = -O2 +LIBS = python$(PY_MAJOR) + +CC_FLAGS = $$($(PKGCONFIG) --cflags $(LIBS)) -std=c99 $(OPTIMISE) -fPIC $(CFLAGS) $(CPPFLAGS) +LD_FLAGS = $$($(PKGCONFIG) --libs $(LIBS)) -lcoopgamma -std=c99 $(OPTIMISE) -shared $(LDFLAGS) + + +all: bin/libcoopgamma_native.so obj/libcoopgamma_native.pyx: src/libcoopgamma_native.pyx.gpp @mkdir -p obj @@ -10,3 +20,10 @@ obj/libcoopgamma_native.pyx: src/libcoopgamma_native.pyx.gpp obj/%.c: obj/%.pyx if ! $(CYTHON) -3 -v $< ; then rm $@ ; false ; fi +obj/%.o: obj/%.c src/*.h + $(CC) $(CC_FLAGS) -iquote"src" -c -o $@ $< + +bin/%.so: obj/%.o + @mkdir -p bin + $(CC) $(LD_FLAGS) -o $@ $^ + |