summaryrefslogtreecommitdiff
path: root/GNUmakefile
blob: 778e185de0bee2e6711182bc375cc2daf80a6f94 (plain)
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
.PHONY: clean build libblt_hw.so
IDIR =./include
CC=gcc
CFLAGS=-I$(IDIR) -I$(KDIR)

SDIR=./src

LIBS=-lpthread

default: build

blt_b2r2.o: $(SDIR)/blt_b2r2.c
	gcc -fPIC -g -c -o $@ $^ $(CFLAGS)

libblt_hw.so: blt_b2r2.o
	gcc -shared -Wl,-soname,libblt_hw.so.1 -o libblt_hw.so.1.0 $^ $(LIBS)

build: libblt_hw.so

install:
	mkdir -p $(DESTDIR)/usr/lib
	find . -name "*.so*"
	cp *.so* $(DESTDIR)/usr/lib/
	ln -s /usr/lib/libblt_hw.so.1.0 $(DESTDIR)/usr/lib/libblt_hw.so.1
	ln -s /usr/lib/libblt_hw.so.1 $(DESTDIR)/usr/lib/libblt_hw.so

	mkdir -p $(DESTDIR)/usr/include
	cp $(IDIR)/*.h $(DESTDIR)/usr/include
clean:
	rm -f *.o *.so.*