From 98929dd2c6a3935c423d3e74cc1e37f4812e091a Mon Sep 17 00:00:00 2001 From: Lillian Salehi Date: Thu, 3 Oct 2024 23:55:40 -0500 Subject: [PATCH] Proto Makefile --- Makefile | 25 ++++++++++++++++++++++--- src/main.cpp | 6 ++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 src/main.cpp diff --git a/Makefile b/Makefile index 06b1626..a3dfc8b 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,18 @@ +CC=gcc +CXX=g++ +CPPFLAGS=-g + +SRC=$(shell find . -name *.cpp) +OBJ=$(SRC:%.cpp=%.o) +BIN= build/placeholderengine + + .PHONY: all -all: placeholder +all: $(BIN) .PHONY: dep -dep: - +dep: + sudo pacman -S $(CC) .PHONY: info info: @echo "make: Build executable" @@ -11,3 +20,13 @@ info: @echo "make debug: Make with Debug hooked in" @echo "make clean: Clean all files" +$(BIN): $(OBJ) + mkdir -p build + $(CXX) $(CPPFLAGS) -o $(BIN) $(OBJ) + +%.o: %.cpp + g++ -c $< -o $@ + +.PHONY: clean +clean: + rm -rf build diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..a0fa66f --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello, World!"; + return 0; +}