aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 12f896f97b51dd10e1a4695e0d5d87f877cba932 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.POSIX:

CONFIGFILE = config.mk
include $(CONFIGFILE)


all: native_bus.so

.o.so:
	$(CC) -o $@ $< -shared $(LDFLAGS)

.c.o:
	$(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS)

.pyx.c:
	if ! $(CYTHON) -$(PYTHON_MAJOR) -v $< -o $@ ; then rm $@; false; fi

install: native_bus.so
	mkdir -p -- "$(DESTDIR)$(PYTHONPKGDIR)"
	cp -- bus.py native_bus.so "$(DESTDIR)$(PYTHONPKGDIR)/"

uninstall:
	-rm -f -- "$(DESTDIR)$(PYTHONPKGDIR)/native_bus.so"
	-rm -f -- "$(DESTDIR)$(PYTHONPKGDIR)/bus"

clean:
	-rm -rf -- __pycache__ *.pyc *.pyo *.o *.so

.SUFFIXES:
.SUFFIXES: .so .o .c .pyx

.PHONY: all install uninstall clean