Update Makefile
This commit is contained in:
23
Makefile
23
Makefile
@@ -1,2 +1,21 @@
|
|||||||
default:
|
# 1. Variables (to avoid repeating yourself)
|
||||||
gcc ray.c -o my_game -Iinclude -Llib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
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
|
||||||
Reference in New Issue
Block a user