aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Makefile16
-rw-r--r--lib/python/setup.py17
2 files changed, 23 insertions, 10 deletions
diff --git a/lib/python/Makefile b/lib/python/Makefile
index e260e64..e23cc9d 100644
--- a/lib/python/Makefile
+++ b/lib/python/Makefile
@@ -1,16 +1,12 @@
-CFLAGS += -fPIC \
- -I../../inc/ \
- $(shell pkg-config --cflags python3)
+include ../../config.mk
-all: alarms.so
+all:
+ $(PYTHON) setup.py build
-%.so: %.o
- $(CC) -shared -o $@ $< $(LDFLAGS)
-
-%.o: %.c
- $(CC) -c -o $@ $< $(CFLAGS)
+install:
+ $(PYTHON) setup.py install --root="$(DESTDIR)/$(PREFIX)"
.PHONY: clean
clean:
- - rm -f alarms.{s,}o
+ - rm -rf build *.egg-info
diff --git a/lib/python/setup.py b/lib/python/setup.py
new file mode 100644
index 0000000..5e3c673
--- /dev/null
+++ b/lib/python/setup.py
@@ -0,0 +1,17 @@
+from setuptools import setup, Extension
+
+if __name__ == "__main__":
+ setup(
+ name="alarms",
+ version="0.1",
+ ext_modules=[
+ Extension(
+ "alarms",
+ language = "C",
+ sources = [ "alarms.c" ],
+ extra_compile_args = [ "-I../../inc" ],
+ libraries = [ "alarm", "uuid" ],
+ library_dirs = [ "../" ]
+ )
+ ]
+ )