From cf79f7fdc8697caca68298a067b5a4989220e6bb Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 21 Jan 2026 15:57:22 +0100 Subject: [PATCH] Use native packages over included submodules. This is the best option out of all, since it removes the requirement of manually managing the dependencies, and should not matter for stable ABI. --- .gitmodules | 7 ------- Makefile | 17 +++++++++++++---- lib/glfw | 1 - lib/libarchive | 1 - 4 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 .gitmodules delete mode 160000 lib/glfw delete mode 160000 lib/libarchive diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 8682479..0000000 --- a/.gitmodules +++ /dev/null @@ -1,7 +0,0 @@ -[submodule "lib/glfw"] - path = lib/glfw - url = https://github.com/glfw/glfw - -[submodule "lib/libarchive"] - path = lib/libarchive - url = https://github.com/libarchive/libarchive diff --git a/Makefile b/Makefile index 14fc07c..847f73c 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,19 @@ DEP := $(addsuffix .d,$(SRC)) CFLAGS := -O2 $(CFLAGS) -g -std=gnu99\ -Wall -Wextra -Wpedantic -Wno-pointer-arith CPPFLAGS := -DNDEBUG $(CPPFLAGS) -DGLFW_INCLUDE_NONE\ - -Iinclude -Ilib/glad/include -Ilib/glfw/include -Ilib/libarchive/libarchive -LDFLAGS := -flto $(LDFLAGS)\ - -Llib/obj/glfw/src -Llib/obj/libarchive/libarchive -LDLIBS := $(LDLIBS) -lglfw3 -larchive -lm + -Iinclude -Ilib/glad/include +LDFLAGS := -flto $(LDFLAGS) +LDLIBS := $(LDLIBS) -lm + +# Use pkg-config to locate dependencies, and set the correct flags. +ifeq (,$(shell command -v pkg-config)) +$(error Failed to locate pkg-config, please make sure it is installed or acessible through PATH.) +else +CPPFLAGS += $(shell pkg-config --cflags-only-I glfw3 libarchive) +LDFLAGS += $(shell pkg-config --libs-only-L glfw3 libarchive) +LDLIBS += $(shell pkg-config --libs-only-l glfw3 libarchive) +endif + msg-cc = $(info [CC] $(1)) msg-clean = $(info [CLEAN] $(1)) diff --git a/lib/glfw b/lib/glfw deleted file mode 160000 index 7b6aead..0000000 --- a/lib/glfw +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7b6aead9fb88b3623e3b3725ebb42670cbe4c579 diff --git a/lib/libarchive b/lib/libarchive deleted file mode 160000 index 9525f90..0000000 --- a/lib/libarchive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9525f90ca4bd14c7b335e2f8c84a4607b0af6bdf