From 7e5e0f49dcb6ba416da5fc9e536109c04f338f95 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 24 Sep 2024 02:27:44 -0400 Subject: Initial commit Signed-off-by: Ian Moffett --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..af6d185 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +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 $@ + +%.o: %.c + mkdir -p $(@D) + $(CC) -c $(CFLAGS_OTLIB) $< -o $@ + +.PHONY: clean +clean: + rm -rf bin/ $(OTLIB_OBJ) -- cgit v1.2.3