From 2667aa2806877d6fdd31b6ad34b0440197c14e1f Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Fri, 24 Jul 2026 20:19:48 +0200 Subject: Fix some layout issues --- Makefile | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 49823c8..0d9dba1 100644 --- a/Makefile +++ b/Makefile @@ -7,13 +7,10 @@ OBJDIR ?= obj TSTDIR ?= test EXMDIR ?= examples -PKGS = sdl2 opengl -LIBS = -lm $(shell pkg-config --libs $(PKGS)) INCS = -Ithirdparty/cglm/include -Ithirdparty/ -Iinc/ -CFLAGS ?= -D_FORTIFY_SOURCE=2 -Wall -Werror -Wno-error=unused-variable -g -Og -CFLAGS += -std=gnu23 -fms-extensions -flto $(shell pkg-config --cflags $(PKGS)) -DCIMGUI_USE_OPENGL3 -DCIMGUI_USE_SDL2 -CXXFLAGS += -flto $(shell pkg-config --cflags $(PKGS)) -DCIMGUI_USE_OPENGL3 -DCIMGUI_USE_SDL2 -DIMGUI_IMPL_API='extern "C"' +CFLAGS ?= -Wall -Werror -Wno-error=unused-variable -g -O0 -lm +CFLAGS += -std=gnu23 -fms-extensions -flto APP_MAIN_SOURCES = $(SRCDIR)/main.c APP_MAIN_OBJS = $(APP_MAIN_SOURCES:%.c=$(OBJDIR)/%.o) @@ -33,8 +30,6 @@ EXM_OBJS = $(EXM_SOURCES:%.c=$(OBJDIR)/%.o) EXM_DEPS = $(EXM_OBJS:%.o=%.d) EXM_APPS = $(EXM_SOURCES:%.c=$(OBJDIR)/%) -IMGUI_OBJS = $(OBJDIR)/thirdparty/cimgui/imgui/backends/imgui_impl_sdl2.o $(OBJDIR)/thirdparty/cimgui/imgui/backends/imgui_impl_opengl3.o - -include $(APP_DEPS) $(APP_MAIN_DEPS) $(TST_DEPS) $(EXM_DEPS) # We don't really need to run the tests for bear to record them @@ -42,14 +37,8 @@ compile_commands.json: clean Makefile $(APP_SOURCES) @rm -f "$@" bear -- make main -.PHONY: thirdparty/cimgui/cimgui.so -thirdparty/cimgui/cimgui.so: - make -C thirdparty/cimgui - -LIBS += -Lthirdparty/cimgui -Wl,-rpath,'$$ORIGIN/thirdparty/cimgui' -lcimgui -lstdc++ - -main: $(APP_MAIN_OBJS) $(APP_OBJS) thirdparty/cimgui/cimgui.so $(IMGUI_OBJS) - $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(APP_MAIN_OBJS) $(APP_OBJS) $(IMGUI_OBJS) $(LIBS) +main: $(APP_MAIN_OBJS) $(APP_OBJS) + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(APP_MAIN_OBJS) $(APP_OBJS) $(OBJDIR)/%.o: %.c @mkdir -p $(dir $@) @@ -61,7 +50,7 @@ $(OBJDIR)/test/%: $(OBJDIR)/test/%.o $(APP_OBJS) $(OBJDIR)/examples/%: $(OBJDIR)/examples/%.o $(APP_OBJS) @mkdir -p $(dir $@) - $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $< $(APP_OBJS) $(LIBS) + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $< $(APP_OBJS) clean: @rm -rf $(OBJDIR) @@ -76,8 +65,3 @@ examples: $(EXM_APPS) .DEFAULT_GOAL := all all: main test examples - -# Imgui specific compile rules -$(OBJDIR)/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CXXFLAGS) $(INCS) -Ithirdparty/cimgui/imgui/ -MMD -o $@ -c $< -- cgit v1.2.3