From ccb9881319276e94fdede79c46c4f0d4c981dc41 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 8 May 2019 22:01:55 +1200 Subject: Refactor build process, use setup.py --- lib/Makefile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'lib/Makefile') diff --git a/lib/Makefile b/lib/Makefile index 4961c4e..ade9772 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,18 +1,25 @@ +include ../config.mk + CFLAGS += -I../inc/ -all: python +all: libalarm.so -python: libalarm.so - make -C python +libalarm.so.1: libalarm.o + $(CC) -shared -o $@ $< $(LDFLAGS) -Wl,-soname,libalarm.so.1 -%.so: %.o - $(CC) -shared -o $@ $< $(LDFLAGS) +libalarm.so: libalarm.so.1 + ln -sf $^ $@ %.o: %.c $(CC) -c -o $@ $< $(LDFLAGS) $(CFLAGS) +install: + install -Dm755 libalarm.so.1 "$(DESTDIR)/$(PREFIX)/lib/libalarm.so.1" + ln -sf libalarm.so.1 "$(DESTDIR)/$(PREFIX)/lib/libalarm.so" + make -C python install + clean: - rm -f libalarm.{s,}o + rm -f libalarm.o libalarm.so.1 make -C python clean .PHONY: python -- cgit v1.1