CFILES_OTLIB = $(shell find lib/ -name "*.c") CFLAGS_OTLIB = -pedantic -Ilib/include/ -fPIC -lssl -lcrypto OTLIB_OBJ = $(CFILES_OTLIB:.c=.o) CC = gcc libostp.so: $(OTLIB_OBJ) gcc -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