Files
obf/Makefile
Aryadev Chavali 9fcd22a03b Simplify build system
RELEASE and DEBUG builds have differing build flags, triggered by
setting RELEASE variable.  No longer doing object based compilation
because:
+ gcc is fast enough without it
+ stale code compilation bugs are annoying
+ having one output binary to clean-up is just easier when switching
build-types
2024-12-03 03:17:44 +00:00

29 lines
411 B
Makefile

CC=gcc
OUT=obf.out
LIBS=
ARGS=
RELEASE=0
GFLAGS=-Wall -Wextra -Werror -Wswitch-enum -std=c11
DFLAGS=-ggdb -fsanitize=address -fsanitize=undefined -DDEBUG
RFLAGS=-O3
ifeq ($(RELEASE), 1)
CFLAGS=$(GFLAGS) $(RFLAGS)
else
CFLAGS=$(GFLAGS) $(DFLAGS)
endif
.PHONY: all
all: $(OUT)
$(OUT): lib.c parser.c main.c
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
.PHONY: run
run: $(OUT)
./$^ $(ARGS)
.PHONY:
clean:
rm -v $(OUT)