diff options
| author | Peter Jones <pjones@redhat.com> | 2021-02-19 13:23:39 -0500 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2021-02-25 10:15:14 -0500 |
| commit | d27c33b2fa544f89433e99f92122d21eaa06861d (patch) | |
| tree | 91b2a6d7ba8af5bdf8f04271e30f44ffa03715f5 | |
| parent | 173ee6b0d8fc31faa961d5ca286bc40371412829 (diff) | |
| download | efi-boot-shim-d27c33b2fa544f89433e99f92122d21eaa06861d.tar.gz efi-boot-shim-d27c33b2fa544f89433e99f92122d21eaa06861d.zip | |
Make 'make fanalyzer' targets
Signed-off-by: Peter Jones <pjones@redhat.com>
| -rw-r--r-- | Make.defaults | 2 | ||||
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | include/fanalyzer.mk | 27 |
3 files changed, 30 insertions, 0 deletions
diff --git a/Make.defaults b/Make.defaults index 1fa2bd5f..799a549d 100644 --- a/Make.defaults +++ b/Make.defaults @@ -91,6 +91,8 @@ endif CFLAGS = -ggdb $(OPTIMIZATIONS) -fno-stack-protector -fno-strict-aliasing -fpic \ -fshort-wchar -Wall -Wsign-compare -Werror -fno-builtin \ -Werror=sign-compare -ffreestanding -std=gnu89 \ + $(if $(filter-out undefined,$(FANALYZER)),-fanalyzer,) \ + $(if $(filter-out undefined,$(COLOR)),-fdiagnostics-color=always,) \ -I$(shell $(CC) $(ARCH_CFLAGS) -print-file-name=include) \ "-DDEFAULT_LOADER=L\"$(DEFAULT_LOADER)\"" \ "-DDEFAULT_LOADER_CHAR=\"$(DEFAULT_LOADER)\"" \ @@ -21,6 +21,7 @@ include $(TOPDIR)/Make.defaults include $(TOPDIR)/Make.rules include $(TOPDIR)/include/coverity.mk include $(TOPDIR)/include/scan-build.mk +include $(TOPDIR)/include/fanalyzer.mk TARGETS = $(SHIMNAME) TARGETS += $(SHIMNAME).debug $(MMNAME).debug $(FBNAME).debug diff --git a/include/fanalyzer.mk b/include/fanalyzer.mk new file mode 100644 index 00000000..1018d1da --- /dev/null +++ b/include/fanalyzer.mk @@ -0,0 +1,27 @@ +GCC_BINARY ?= $(shell x=$$(which --skip-alias --skip-functions gcc 2>/dev/null) ; [ -n "$$x" ] && echo "$$x") + +fanalyzer-test : ; $(if $(findstring /,$(GCC_BINARY)),,$(error gcc not found)) + +define prop +$(if $(filter-out undefined,$(origin $(1))),$(1)=$($1),) +endef + +MAKEARGS := \ + $(call prop,ARCH) \ + $(call prop,COLOR) \ + $(call prop,CROSS_COMPILE) + +fanalyzer : | fanalyzer-test +fanalyzer : clean-shim-objs fanalyzer-build + +fanalyzer-build : + make CC=gcc $(MAKEARGS) $(DASHJ) Cryptlib/OpenSSL/libopenssl.a Cryptlib/libcryptlib.a + make CC=gcc $(MAKEARGS) FANALYZER=true all + +fanalyzer-all : | fanalyzer-test +fanalyzer-all : clean fanalyzer-build-all + +fanalyzer-build-all : + make CC=gcc $(MAKEARGS) FANALYZER=true all + +.PHONY : fanalyzer fanalyzer-build fanalyzer-all fanalyzer-build-all fanalyzer-clean |
