summaryrefslogtreecommitdiff
path: root/Makefile
blob: e5d5a726378964703e4fec39db09ba084ea520f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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/*