diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2026-07-24 20:19:48 +0200 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2026-07-24 20:19:48 +0200 |
| commit | 2667aa2806877d6fdd31b6ad34b0440197c14e1f (patch) | |
| tree | 2c7fc9ded8170e3794c505c3ff50f610dd538c3e /Makefile | |
| parent | 1af2dfbde432af9f13e8fba09b7ca29f5de71863 (diff) | |
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 26 |
1 files changed, 5 insertions, 21 deletions
@@ -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 $< |
