From f52e10b10b9d39dabf6e057cd4ab6e980d97240b Mon Sep 17 00:00:00 2001 From: not-a-robot06 <72096472+not-a-robot06@users.noreply.github.com> Date: Sun, 7 Apr 2024 08:41:45 +0100 Subject: initial commit --- Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e5d5a72 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +ifneq (, $(shell which clang)) + CC:=clang +else ifneq (, $(shell which gcc)) + CC:=gcc +else ifneq (, $(shell which cc)) + CC:=cc +else + $(error "No C compiler found (!)") +endif + +CFLAGS:=-Wall -Wextra -Wpedantic -std=c99 -D_POSIX_C_SOURCE=200112L -g3 +LDFLAGS:= +DIRS:=bin +BINS:=bin/http + +all: dirs $(BINS) + +run: dirs $(BINS) + bin/http + +bin/%: %.c + $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ + +dirs: $(DIRS) +$(DIRS): + @mkdir -p $(DIRS) + +clean: + rm bin/* -- cgit v1.2.3