aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-02-16 12:06:15 +0000
committerRon Yorston <rmy@pobox.com>2024-02-16 12:06:15 +0000
commit0200baa675d3b51c0f021da7728353ee7ceedba4 (patch)
tree2c60bea606dc2d2f0976f158de977c1babd0384a
parenta4bb355732f2902b936368b644fa08518ecce55a (diff)
downloadbusybox-w32-0200baa675d3b51c0f021da7728353ee7ceedba4.tar.gz
busybox-w32-0200baa675d3b51c0f021da7728353ee7ceedba4.tar.bz2
busybox-w32-0200baa675d3b51c0f021da7728353ee7ceedba4.zip
build system: avoid full rebuild when EXTRAVERSION changes
The last two commits allow EXTRAVERSION to track the current state of a git repository. The build system was unable to determine which files were affected by changes to EXTRAVERSION and caused a full rebuild when it changed. Alter how the version information is passed to the code so only a handful of files need to be rebuilt when it changes.
-rw-r--r--Makefile10
-rw-r--r--Makefile.flags2
-rw-r--r--archival/tar.c3
-rw-r--r--editors/vi.c3
-rw-r--r--libbb/messages.c3
-rw-r--r--miscutils/bc.c3
-rw-r--r--networking/httpd.c3
7 files changed, 25 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c12b7791f..30a24f68e 100644
--- a/Makefile
+++ b/Makefile
@@ -892,7 +892,7 @@ endif
892# prepare2 creates a makefile if using a separate output directory 892# prepare2 creates a makefile if using a separate output directory
893prepare2: prepare3 outputmakefile 893prepare2: prepare3 outputmakefile
894 894
895prepare1: prepare2 include/config/MARKER 895prepare1: prepare2 include/config/MARKER include/BB_VER.h
896ifneq ($(KBUILD_MODULES),) 896ifneq ($(KBUILD_MODULES),)
897 $(Q)mkdir -p $(MODVERDIR) 897 $(Q)mkdir -p $(MODVERDIR)
898 $(Q)rm -f $(MODVERDIR)/* 898 $(Q)rm -f $(MODVERDIR)/*
@@ -956,6 +956,13 @@ define filechk_version.h
956 ) 956 )
957endef 957endef
958 958
959define filechk_BB_VER.h
960 (echo \#define BB_VER \"$(KERNELRELEASE)\";)
961endef
962
963include/BB_VER.h: $(srctree)/Makefile .config .kernelrelease FORCE
964 $(call filechk,BB_VER.h)
965
959# --------------------------------------------------------------------------- 966# ---------------------------------------------------------------------------
960 967
961PHONY += depend dep 968PHONY += depend dep
@@ -1051,6 +1058,7 @@ CLEAN_FILES += busybox$(EXEEXT) busybox_unstripped* busybox.links \
1051MRPROPER_DIRS += include/config include2 1058MRPROPER_DIRS += include/config include2
1052MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1059MRPROPER_FILES += .config .config.old include/asm .version .old_version \
1053 include/NUM_APPLETS.h \ 1060 include/NUM_APPLETS.h \
1061 include/BB_VER.h \
1054 include/common_bufsiz.h \ 1062 include/common_bufsiz.h \
1055 include/autoconf.h \ 1063 include/autoconf.h \
1056 include/bbconfigopts.h \ 1064 include/bbconfigopts.h \
diff --git a/Makefile.flags b/Makefile.flags
index 8be999cb2..f24fd9475 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -17,7 +17,7 @@ CPPFLAGS += \
17 $(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \ 17 $(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \
18 $(if $(CONFIG_TIME64),-D_TIME_BITS=64) \ 18 $(if $(CONFIG_TIME64),-D_TIME_BITS=64) \
19 -DMINGW_VER=$(squote)$(quote)$(MINGW_VER)$(quote)$(squote) \ 19 -DMINGW_VER=$(squote)$(quote)$(MINGW_VER)$(quote)$(squote) \
20 -DBB_VER=$(squote)$(quote)$(BB_VER)$(quote)$(squote) 20 $(if $(CONFIG_PLATFORM_MINGW32),,-DBB_VER=$(squote)$(quote)$(BB_VER)$(quote)$(squote))
21 21
22CFLAGS += $(call cc-option,-Wall,) 22CFLAGS += $(call cc-option,-Wall,)
23CFLAGS += $(call cc-option,-Wshadow,) 23CFLAGS += $(call cc-option,-Wshadow,)
diff --git a/archival/tar.c b/archival/tar.c
index bb82560b8..23ea02b5d 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -119,6 +119,9 @@
119#include "libbb.h" 119#include "libbb.h"
120#include "common_bufsiz.h" 120#include "common_bufsiz.h"
121#include "bb_archive.h" 121#include "bb_archive.h"
122#if ENABLE_PLATFORM_MINGW32
123# include "BB_VER.h"
124#endif
122/* FIXME: Stop using this non-standard feature */ 125/* FIXME: Stop using this non-standard feature */
123#ifndef FNM_LEADING_DIR 126#ifndef FNM_LEADING_DIR
124# define FNM_LEADING_DIR 0 127# define FNM_LEADING_DIR 0
diff --git a/editors/vi.c b/editors/vi.c
index b49d5454d..7ad8412a2 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -214,6 +214,9 @@
214#if ENABLE_FEATURE_VI_REGEX_SEARCH 214#if ENABLE_FEATURE_VI_REGEX_SEARCH
215# include <regex.h> 215# include <regex.h>
216#endif 216#endif
217#if ENABLE_PLATFORM_MINGW32
218# include "BB_VER.h"
219#endif
217 220
218// the CRASHME code is unmaintained, and doesn't currently build 221// the CRASHME code is unmaintained, and doesn't currently build
219#define ENABLE_FEATURE_VI_CRASHME 0 222#define ENABLE_FEATURE_VI_CRASHME 0
diff --git a/libbb/messages.c b/libbb/messages.c
index 3c9d8683a..12079a2e0 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -5,6 +5,9 @@
5 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 5 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 */ 6 */
7#include "libbb.h" 7#include "libbb.h"
8#if ENABLE_PLATFORM_MINGW32
9# include "BB_VER.h"
10#endif
8 11
9/* allow version to be extended, via CFLAGS */ 12/* allow version to be extended, via CFLAGS */
10#ifndef BB_EXTRA_VERSION 13#ifndef BB_EXTRA_VERSION
diff --git a/miscutils/bc.c b/miscutils/bc.c
index a82646674..31485ae9c 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -203,6 +203,9 @@
203 203
204#include "libbb.h" 204#include "libbb.h"
205#include "common_bufsiz.h" 205#include "common_bufsiz.h"
206#if ENABLE_PLATFORM_MINGW32
207# include "BB_VER.h"
208#endif
206 209
207#if !ENABLE_BC && !ENABLE_FEATURE_DC_BIG 210#if !ENABLE_BC && !ENABLE_FEATURE_DC_BIG
208# include "dc.c" 211# include "dc.c"
diff --git a/networking/httpd.c b/networking/httpd.c
index c76ce3658..bd3a5a097 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -299,6 +299,9 @@
299 299
300#include "libbb.h" 300#include "libbb.h"
301#include "common_bufsiz.h" 301#include "common_bufsiz.h"
302#if ENABLE_PLATFORM_MINGW32
303# include "BB_VER.h"
304#endif
302#if ENABLE_PAM 305#if ENABLE_PAM
303/* PAM may include <locale.h>. We may need to undefine bbox's stub define: */ 306/* PAM may include <locale.h>. We may need to undefine bbox's stub define: */
304# undef setlocale 307# undef setlocale