aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: deebcc6f32ab6637eab46cb2559875f247ecdc96 (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
CFILES_OTLIB = $(shell find lib/ -name "*.c")
CFLAGS_OTLIB = -pedantic -Ilib/include/ -fPIC
OTLIB_OBJ = $(CFILES_OTLIB:.c=.o)

libostp.so: $(OTLIB_OBJ)
	$(CC) -shared -o $@ $(OTLIB_OBJ)

%.o: %.c
	mkdir -p $(@D)
	$(CC) -c $(CFLAGS_OTLIB) $< -o $@

.PHONY: clean
clean:
	rm -rf $(OTLIB_OBJ)

.PHONY: headers
headers:
	mkdir -p /usr/include/ostp/
	cp -r lib/include/* /usr/include/ostp/

.PHONY: install
install:
	cp libostp.so /usr/lib
	chmod 0755 /usr/lib/libostp.so
	ldconfig