aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-10-01 00:24:54 -0400
committerIan Moffett <ian@osmora.org>2024-10-01 00:25:11 -0400
commit9b50f08c3995c2215420bba8eca029b14514dfac (patch)
treec73be9812e8cfabc451dd370512a0d819c70957a /Makefile
parent7d1a25045f30882dd5d5618a83b4bbb5564ebf8f (diff)
project: Convert project to library
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 14 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index af6d185..c287b3c 100644
--- a/Makefile
+++ b/Makefile
@@ -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