diff options
author | Ian Moffett <ian@osmora.org> | 2024-09-24 02:27:44 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-09-24 02:27:44 -0400 |
commit | 7e5e0f49dcb6ba416da5fc9e536109c04f338f95 (patch) | |
tree | 5853085d1db6ab1325275d94dc25b216b3a0f1c1 /Makefile |
Initial commit
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 27 insertions, 0 deletions
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) |