summaryrefslogtreecommitdiff
path: root/Makefile
blob: 1583287b101908abae5a10ce03fd2215a3ec5a5a (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
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -fwrapv
ifneq ($(DEBUG),)
	CFLAGS += -g
else
	CFLAGS += -O2
endif
BIN = cserver

.PHONY: all clean remake

all: $(BIN)

clean:
	rm -rf $(BIN) *.o *.dSYM

remake: clean all


$(BIN): $(patsubst %.c,%.o,$(wildcard *.c))
	$(CC) -o $@ $^

%.o: %.cpp $(wildcard *.h)
	$(CC) $(CFLAGS) -c -o $@ $<