From 2a88947f036ca3c9f88a9e2265229ceb5ae3367d Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 22 Apr 2023 00:47:10 -0400 Subject: initial --- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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 -- cgit v1.2.3-freya