summaryrefslogtreecommitdiffstats
path: root/config/vars.mk
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-10 13:13:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-10 13:23:40 -0400
commit6c8d11e8e5b3457286fcda75b6516e93f1f12f17 (patch)
treeb637ba7322df4e60e4e8174f53b48348b8f408a1 /config/vars.mk
parent8f5ce115d51d31756b6911310a0deb1bafba46c0 (diff)
downloadbfs-6c8d11e8e5b3457286fcda75b6516e93f1f12f17.tar.xz
build: Run pkg-config with all packages at once
Diffstat (limited to 'config/vars.mk')
-rw-r--r--config/vars.mk21
1 files changed, 21 insertions, 0 deletions
diff --git a/config/vars.mk b/config/vars.mk
new file mode 100644
index 0000000..a8fae9d
--- /dev/null
+++ b/config/vars.mk
@@ -0,0 +1,21 @@
+# Copyright © Tavian Barnes <tavianator@tavianator.com>
+# SPDX-License-Identifier: 0BSD
+
+# Makefile fragment loads and exports variables for config steps
+
+GEN := ${BUILDDIR}/gen
+GEN := ${GEN:./%=%}
+
+include ${GEN}/vars.mk
+
+_CC := ${CC}
+_CPPFLAGS := ${CPPFLAGS}
+_CFLAGS := ${CFLAGS}
+_LDFLAGS := ${LDFLAGS}
+_LDLIBS := ${LDLIBS}
+
+export CC=${_CC}
+export CPPFLAGS=${_CPPFLAGS}
+export CFLAGS=${_CFLAGS}
+export LDFLAGS=${_LDFLAGS}
+export LDLIBS=${_LDLIBS}