aboutsummaryrefslogtreecommitdiffstats
path: root/GNUmakefile
blob: 8a550ff4e977315a230d8040059ce655fe1c63a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
CC := cc
CCFLAGS := -O3 -std=c99 -pedantic -Wall -Wextra -Wno-missing-field-initalizers
LDFLAGS := -lraylib #-lm
SRC_DIR := src
DST_DIR := dst
SRCS := $(shell find $(SRC_DIR) -name "*.c" -type f)
OBJS := $(SRCS:%=$(DST_DIR)/%.o)

physics: $(OBJS)
	$(CC) $(CCFLAGS) -o $@ $(LDFLAGS)

$(DST_DIR)/%.c.o: %.c
	mkdir -p $(dir $@)
	$(CC) $(CCFLAGS) -c $< -o $@

.PHONY: clean
clean:
	rm -r $(DST_DIR)