diff options
author | root <root@bpcserver.bpcserver> | 2024-02-27 21:53:44 -0600 |
---|---|---|
committer | root <root@bpcserver.bpcserver> | 2024-02-27 21:53:44 -0600 |
commit | afa02f645056c5823b0d8a29d37c1ff10aedce7a (patch) | |
tree | 0bc89e7909c17d8f33538ac9f31a641872b89f40 /makefile |
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/makefile b/makefile new file mode 100644 index 0000000..667f693 --- /dev/null +++ b/makefile @@ -0,0 +1,23 @@ +CC := g++ +BUILD_DIR := build +CCOPTS := -Wall -Wextra -ggdb -pedantic-errors +SRC_DIR := ./ +OUTPUT := $(shell basename $(CURDIR)).elf + +SRCFILES := $(wildcard ./$(SRC_DIR)/*.cpp) +OBJFILES := $(patsubst ./$(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(SRCFILES)) + +make: BUILD_DIR $(OBJFILES) + $(CC) $(CCOPTS) -o $(OUTPUT) $(OBJFILES) + +debug: + gdb -x debug.gdb $(OUTPUT) + +$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp + $(CC) $(CCOPTS) -c $< -o $@ + +BUILD_DIR: + mkdir -p $(BUILD_DIR) + +clean: + rm -rf build/ $(OUTPUT) |