summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7ba8b50b89b58c7a246cdb6e5828e299d725a520 (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
CC=gcc
RELEASE=0

GFLAGS=-Wall -Wextra -Wswitch-enum -std=c11
DFLAGS=-fsanitize=address -fsanitize=undefined -ggdb
RFLAGS=-O3

ifeq ($(RELEASE), 0)
CFLAGS=$(GFLAGS) $(DFLAGS)
else
CFLAGS=$(GFLAGS) $(RFLAGS)
endif

DIST=build
OUT=avm.out

all: $(DIST)/$(OUT)

$(DIST)/$(OUT): main.c | $(DIST)
	$(CC) $(CFLAGS) $^ -o $@

.PHONY: run
run: $(DIST)/$(OUT)
	./$^

$(DIST):
	mkdir $(DIST)