blob: 50e8da0bf82f0e54a9cc3678d60fced171658aac (
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
|
DIAG=yes
CFILES_OTLIB = $(shell find lib/ -name "*.c")
CFLAGS_OTLIB = -pedantic -Ilib/include/ -fPIC
OTLIB_OBJ = $(CFILES_OTLIB:.c=.o)
ifeq ($(DIAG),yes)
CFLAGS_OTLIB += -D_DIAGNOSTIC
endif
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
|