diff --git a/Makefile b/Makefile index 6b0345a..f324735 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,21 @@ -default: - gcc ray.c -o my_game -Iinclude -Llib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 +# 1. Variables (to avoid repeating yourself) +CC = gcc +CFLAGS = -Iinclude +LDFLAGS = -Llib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 + +# 2. Default target (runs when you just type 'make') +default: visual text + +# 3. Specific build targets +visual: ray.c + $(CC) ray.c -o ray.out $(CFLAGS) $(LDFLAGS) + +text: text_physics.c + $(CC) text_physics.c -o text_physics.out $(CFLAGS) $(LDFLAGS) + +# 4. Cleanup targets (all mapped to the same action) +clean clear rm remove wipe: + rm -f ray.out text_physics.out + +# 5. Phony targets (tells make these are actions, not actual files) +.PHONY: default visual text clean clear rm remove wipe \ No newline at end of file