summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7d82ff52156c666e1417088f6203ff99450caaa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -g -O2 -fwrapv
LDFLAGS = -lz

OBJDIR = obj

.PHONY: all clean

.SUFFIXES:

all: $(patsubst %.c,$(OBJDIR)/%.o,$(wildcard *.c))

clean:
	@echo "Cleaning"
	@rm -rf $(OBJDIR)


$(OBJDIR)/%.o: %.c $(wildcard *.h)
	@mkdir -p $(OBJDIR)
	@echo "CC $<"
	@$(CC) $(CFLAGS) -c -o $@ $<