diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 14 insertions, 15 deletions
@@ -1,22 +1,10 @@ -CFILES_OTD = $(shell find ostp.d/ -name "*.c") CFILES_OTLIB = $(shell find lib/ -name "*.c") -CFILES_CLIENT = $(shell find client/ -name "*.c") -CFLAGS_OTD = -pedantic -Iostp.d/include/ -Ilib/include/ -CFLAGS_CLIENT = -pedantic -Iclient/include/ -Ilib/include/ CFLAGS_OTLIB = -pedantic -Ilib/include/ -fPIC -lssl -lcrypto OTLIB_OBJ = $(CFILES_OTLIB:.c=.o) CC = gcc -.PHONY: all -all: $(OTLIB_OBJ) bin/ostp.d bin/client - -bin/ostp.d: $(CFILES_OTD) - mkdir -p $(@D) - $(CC) $(CFLAGS_OTD) $(OTLIB_OBJ) $^ -lssl -lcrypto -o $@ - -bin/client: $(CFILES_CLIENT) - mkdir -p $(@D) - $(CC) $(CFLAGS_CLIENT) $(OTLIB_OBJ) $^ -lssl -lcrypto -o $@ +libostp.so: $(OTLIB_OBJ) + gcc -shared -o $@ $(OTLIB_OBJ) %.o: %.c mkdir -p $(@D) @@ -24,4 +12,15 @@ bin/client: $(CFILES_CLIENT) .PHONY: clean clean: - rm -rf bin/ $(OTLIB_OBJ) + 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 |