|
@@ -747,6 +747,33 @@ include/assert.h : $(ASSERT_LIST)
|
747
|
747
|
|
748
|
748
|
.PRECIOUS : include/assert.h
|
749
|
749
|
|
|
750
|
+# (Single-element) list of profiling configuration
|
|
751
|
+#
|
|
752
|
+PROFILE_LIST := $(BIN)/.profile.list
|
|
753
|
+ifeq ($(wildcard $(PROFILE_LIST)),)
|
|
754
|
+PROFILE_OLD := <invalid>
|
|
755
|
+else
|
|
756
|
+PROFILE_OLD := $(shell cat $(PROFILE_LIST))
|
|
757
|
+endif
|
|
758
|
+ifneq ($(PROFILE_OLD),$(PROFILE))
|
|
759
|
+$(shell $(ECHO) "$(PROFILE)" > $(PROFILE_LIST))
|
|
760
|
+endif
|
|
761
|
+
|
|
762
|
+$(PROFILE_LIST) : $(MAKEDEPS)
|
|
763
|
+
|
|
764
|
+VERYCLEANUP += $(PROFILE_LIST)
|
|
765
|
+
|
|
766
|
+# Profiling configuration
|
|
767
|
+#
|
|
768
|
+ifneq ($(PROFILE),)
|
|
769
|
+CFLAGS += -DPROFILING=$(PROFILE)
|
|
770
|
+endif
|
|
771
|
+
|
|
772
|
+include/ipxe/profile.h : $(PROFILE_LIST)
|
|
773
|
+ $(Q)$(TOUCH) $@
|
|
774
|
+
|
|
775
|
+.PRECIOUS : include/ipxe/profile.h
|
|
776
|
+
|
750
|
777
|
# These files use .incbin inline assembly to include a binary file.
|
751
|
778
|
# Unfortunately ccache does not detect this dependency and caches
|
752
|
779
|
# builds even when the binary file has changed.
|