diff options
author | Tyler Murphy <tylerm@tylerm.dev> | 2023-04-22 00:47:10 -0400 |
---|---|---|
committer | Tyler Murphy <tylerm@tylerm.dev> | 2023-04-22 00:47:10 -0400 |
commit | 2a88947f036ca3c9f88a9e2265229ceb5ae3367d (patch) | |
tree | 97e399ac6efd7c58d91fe27a5bf9ae87232412e5 /Makefile | |
download | raycaster-2a88947f036ca3c9f88a9e2265229ceb5ae3367d.tar.gz raycaster-2a88947f036ca3c9f88a9e2265229ceb5ae3367d.tar.bz2 raycaster-2a88947f036ca3c9f88a9e2265229ceb5ae3367d.zip |
initial
Diffstat (limited to '')
-rw-r--r-- | Makefile | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e321478 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +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: + cp $(APP) /usr/local/bin/wrapper + +uninstall: + rm /usr/local/bin/wrapper |