Entirely expanded upon existing proof-of-concept
This commit is contained in:
33
Makefile
33
Makefile
@@ -1,21 +1,22 @@
|
||||
# 1. Variables (to avoid repeating yourself)
|
||||
CC = gcc
|
||||
CFLAGS = -Iinclude
|
||||
LDFLAGS = -Llib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
||||
CC=gcc
|
||||
|
||||
# 2. Default target (runs when you just type 'make')
|
||||
default: visual text
|
||||
SRC=src/main.c \
|
||||
src/world.c \
|
||||
src/player.c \
|
||||
src/physics.c \
|
||||
src/render.c
|
||||
|
||||
# 3. Specific build targets
|
||||
visual: ray.c
|
||||
$(CC) ray.c -o ray.out $(CFLAGS) $(LDFLAGS)
|
||||
OUT=wrldbox
|
||||
|
||||
text: text_physics.c
|
||||
$(CC) text_physics.c -o text_physics.out $(CFLAGS) $(LDFLAGS)
|
||||
INCLUDES=-Iinclude
|
||||
LIBPATH=-Llib
|
||||
|
||||
# 4. Cleanup targets (all mapped to the same action)
|
||||
clean clear rm remove wipe:
|
||||
rm -f ray.out text_physics.out
|
||||
CFLAGS=-O2 -Wall
|
||||
|
||||
# 5. Phony targets (tells make these are actions, not actual files)
|
||||
.PHONY: default visual text clean clear rm remove wipe
|
||||
LIBS=-lraylib -lX11 -ldl -lpthread -lm
|
||||
|
||||
all:
|
||||
$(CC) $(SRC) $(CFLAGS) $(INCLUDES) $(LIBPATH) -o $(OUT) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(OUT)
|
||||
|
||||
Reference in New Issue
Block a user