diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 29 |
1 files changed, 29 insertions, 0 deletions
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/* |
