]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
build: Recompile on `.config` changes (workaround)
authorSimon Kuenzer <simon@unikraft.io>
Sat, 30 Sep 2023 00:06:34 +0000 (02:06 +0200)
committerRazvan Deaconescu <razvand@unikraft.io>
Fri, 20 Oct 2023 16:35:55 +0000 (19:35 +0300)
Our build system is still not able to re-trigger the compilation if only
the command line of a compilation unit changed due to a configuration
change. This resulted in broken builds if the user did not call `make
clean` in between.
This commit introduces a workaround that attempts to improve the user
experience by triggering a recompile when the configuration is changed.
This makes this cleaning step unecessary.

It is intended that this commit gets reverted as soon as the build system
can properly detect changes to the compiler command line.

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1119

support/build/Makefile.rules

index de6386ac9d36eab04c77435d9b9868713aa7a60c..5a8e8e80eb83dc4c82e687c9f660f1431cedcbdc 100644 (file)
@@ -819,7 +819,12 @@ $(error buildrule_$(call fileext,$(strip $(2))) is not defined: Failed to instal
 $(call buildrule_$(call fileext,$(strip $(2))),$(strip $(1)),$(strip $(2)),$(strip $(3)),$(strip $(4)),$(strip $(5)))
 
 # Default buildrule_* dependencies
-$(4): $(call qstrip,$($(call vprefix_src,$(1),$(2),$(3),CDEPS)) $($(call vprefix_src,$(1),$(2),$(3),CDEPS-y))) | preprocess
+# FIXME: We add $(KCONFIG_AUTOHEADER) in order to forcefully retrigger compiling
+#        whenever there is a config change. This is a workaround until we can
+#        handle changes that affect the compile command lines properly.
+$(4): $(call qstrip,$($(call vprefix_src,$(1),$(2),$(3),CDEPS)) \
+      $($(call vprefix_src,$(1),$(2),$(3),CDEPS-y))) $(KCONFIG_AUTOHEADER) \
+      | preprocess
 endef
 
 #################################################
@@ -886,8 +891,11 @@ $(error preprule_$(call fileext,$(strip $(2))) is not defined: Failed to install
 
 $(call preprule_$(call fileext,$(strip $(2))),$(strip $(1)),$(strip $(2)),$(strip $(3)),$(strip $(4)),$(strip $(5)))
 
-# default preprule dependencies
-$(strip $(3)): $(strip $(2))
+# Default preprule dependencies
+# FIXME: We add $(KCONFIG_AUTOHEADER) in order to forcefully retrigger compiling
+#        whenever there is a config change. This is a workaround until we can
+#        handle changes that affect the compile command lines properly.
+$(strip $(3)): $(strip $(2)) $(KCONFIG_AUTOHEADER)
 endef