From 1c1b1ea41f9ff1c1e80c7ea881ae0bbc18e1a2c4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 4 Aug 2024 19:40:09 +0300 Subject: [PATCH] init Makefile --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..0ad7f248 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +# Define compiler and flags +CXX = g++ +CXXFLAGS = `pkg-config --cflags gtk4` +LDFLAGS = `pkg-config --libs gtk4` + +# Define target executable and source files +TARGET = bin/Yoda +SRCS = src/main.cpp $(wildcard src/**/*.cpp) + +OBJS = $(SRCS:.cpp=.o) + +# Default target +all: $(TARGET) + +# Rule to build the executable +$(TARGET): $(OBJS) + $(CXX) -o $@ $(OBJS) $(LDFLAGS) + +# Rule to build object files from source files +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $< -o $@ + +# Rule to clean up build files +clean: + rm -f $(TARGET) $(OBJS) \ No newline at end of file