APPNAME = app
RELEASE_ARGS = -Wall -Wextra -Werror
DEBUG_ARGS = -g -DDEBUG
ARGS = -lcurl

release: prelude
	@gcc $(ARGS) $(RELEASE_ARGS) -o build/$(APPNAME) ./src/main.c
	@./build/$(APPNAME)

test: prelude
	@gcc $(ARGS) $(DEBUG_ARGS) -o build/test ./src/test.c
	@./build/test

debug: prelude
	@gcc $(ARGS) $(DEBUG_ARGS) -o build/$(APPNAME) ./src/main.c
	@./build/$(APPNAME)

lldb: prelude
	@gcc $(ARGS) $(DEBUG_ARGS) -o build/$(APPNAME) ./src/main.c
	@lldb ./build/$(APPNAME)

scratch: prelude
	@gcc $(ARGS) $(DEBUG_ARGS) -o build/scratch ./src/scratch.c
	@./build/scratch

prelude:
	@mkdir -p build
