raycaster/Makefile

43 lines
621 B
Makefile
Raw Normal View History

2023-04-22 04:47:10 +00:00
CC = gcc
INCFLAGS = -Isrc
CCFLAGS = -std=c99 -Wall -Wextra -pedantic -O2
CCFLAGS += $(INCFLAGS)
LDFLAGS += $(INCFLAGS)
LDFLAGS += -lSDL2
LDFLAGS += -lm
BIN = bin
APP = $(BIN)/app
SRC = $(shell find src -name "*.c")
OBJ = $(SRC:%.c=$(BIN)/%.o)
.PHONY: dirs run clean build install uninstall
EOF: clean build
dirs:
mkdir -p ./$(BIN)
mkdir -p ./$(BIN)/src
run: build
$(APP)
build: dirs ${OBJ}
${CC} -o $(APP) $(filter %.o,$^) $(LDFLAGS)
$(BIN)/%.o: %.c
$(CC) -o $@ -c $< $(CCFLAGS)
clean:
rm -rf $(APP)
rm -rf $(BIN)
install:
2023-04-22 04:47:36 +00:00
cp $(APP) /usr/local/bin/raycaster
2023-04-22 04:47:10 +00:00
uninstall:
2023-04-22 04:47:36 +00:00
rm /usr/local/bin/raycaster