From 7e60437d3c064bca402d486be967c43bf4326067 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 3 Sep 2025 23:31:40 +0200 Subject: Initial (with old code) This includes old code too, perhaps from 2021-05-05, judging from the birth timestamp on the directory. The old code included option parsing and equation solving for fancy mutually-dependent options, but no actual rendering (imagine that). --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ed2da60 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +CXX = g++ +CXXFLAGS = -Wall -Wextra -std=c++20 -march=native +CXXFLAGS += -D_DEFAULT_SOURCE +LDFLAGS = -lpng +BIN = buddhabrot + +OBJDIR = .obj + +ifneq ($(DEBUG),) + CXXFLAGS += -Og -g -fsanitize=address + LDFLAGS += -fsanitize=address +else + CXXFLAGS += -O3 +endif + +SOURCES := $(wildcard *.cpp) +OBJECTS := $(patsubst %.cpp,$(OBJDIR)/%.o,$(SOURCES)) +HEADERS := $(wildcard *.h) + +.PHONY: all clean + +all: $(BIN) + +clean: + rm -rf $(BIN) $(OBJDIR) + + +$(BIN): $(OBJECTS) + $(CXX) -o $@ $^ $(LDFLAGS) + +$(OBJDIR)/%.o: %.cpp $(HEADERS) | $(OBJDIR) + $(CXX) $(CXXFLAGS) -c -o $@ $< + +$(OBJDIR): + mkdir $@ -- cgit v1.2.3-70-g09d2