diff options
| author | not-a-robot06 <72096472+not-a-robot06@users.noreply.github.com> | 2024-04-07 08:41:45 +0100 |
|---|---|---|
| committer | not-a-robot06 <72096472+not-a-robot06@users.noreply.github.com> | 2024-04-07 08:41:45 +0100 |
| commit | f52e10b10b9d39dabf6e057cd4ab6e980d97240b (patch) | |
| tree | 5187a867c42984b239528011f80a74e94768eb50 /Makefile | |
| download | http-server-f52e10b10b9d39dabf6e057cd4ab6e980d97240b.tar.gz http-server-f52e10b10b9d39dabf6e057cd4ab6e980d97240b.tar.bz2 http-server-f52e10b10b9d39dabf6e057cd4ab6e980d97240b.zip | |
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/* |
