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

.PHONY: all clean remake

all: attract

clean:
	rm -f attract *.o

remake: clean
	$(MAKE) --no-print-directory all


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

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