BIN=dorianocacasorus

all:
	gcc -Wall -Wextra -ggdb main.c -o $(BIN) -Ilib -Llib/ -lraylib -lm

run: all
	./$(BIN)

release: bake
	gcc -Wall -Wextra -O3 -ggdb -DRELEASE main.c -o $(BIN)-linux -Ilib -Llib/ -lraylib -lm
	x86_64-w64-mingw32-gcc -Wall -Wextra -O3 -DRELEASE main.c -o $(BIN)-windows -Ilib -Llib -lwindows-raylib -lgdi32 -lwinmm

dist: clear release
	mkdir $(BIN)
	cp $(BIN)-linux $(BIN)-windows.exe $(BIN)
	zip $(BIN) $(BIN)/*
	rm -r $(BIN)/

clear:
	rm -fr $(BIN) $(BIN)-linux $(BIN)-windows.exe bakery assets/*.h $(BIN).zip

bakery: bakery.c
	gcc -Wall -Wextra -O3 bakery.c -o bakery -lm

bake: bakery
	./bakery assets/fond.png assets/fond.h menufond
	./bakery assets/bittersweet.mp3 assets/bittersweet.h musique
	./bakery assets/Keyboard_Space.png assets/Keyboard_Space.h tuto_space
	./bakery assets/Keyboard_Arrows.png assets/Keyboard_Arrows.h tuto_key
	./bakery assets/raccon-delicieu.png assets/raccon-delicieu.h raccoon
