From 3bf26f2808be867b069dcaae28cf4a523e89c2e7 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 1 Jun 2019 22:49:28 +0200 Subject: [PATCH] simplify makefile --- Makefile | 26 ++------------------------ armsrc/Makefile | 25 +++---------------------- common/Makefile.hal | 11 +++++++++++ 3 files changed, 16 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index 1b27be069..122c0bb3c 100644 --- a/Makefile +++ b/Makefile @@ -23,32 +23,10 @@ else PATHSEP=\\# endif -ifeq ($(PLATFORM),) - -include Makefile.platform - -include .Makefile.options.cache - ifeq ($(PLATFORM),) - PLATFORM=PM3RDV4 - else - ${info using saved PLATFORM: '$(PLATFORM)'} - endif - ifneq ($(PLATFORM_EXTRAS),) - ${info using saved PLATFORM_EXTRAS: '$(PLATFORM_EXTRAS)'} - endif - ifneq ($(STANDALONE),) - ${info using saved STANDALONE: '$(STANDALONE)'} - endif -endif - +-include Makefile.platform +-include .Makefile.options.cache include common/Makefile.hal -$(info ===================================================================) -$(info Platform name: $(PLTNAME)) -$(info PLATFORM: $(PLATFORM)) -$(info PLATFORM_EXTRAS: $(PLATFORM_EXTRAS)) -$(info Included options: $(PLATFORM_DEFS_INFO)) -$(info Standalone mode: $(PLATFORM_DEFS_INFO_STANDALONE)) -$(info ===================================================================) - all clean: %: client/% bootrom/% armsrc/% recovery/% mfkey/% nonce2key/% mfkey/%: FORCE diff --git a/armsrc/Makefile b/armsrc/Makefile index e7788776a..1c580c005 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -12,30 +12,11 @@ APP_INCLUDES = apps.h ifeq ($(PLTNAME),) -include ../Makefile.platform -include ../.Makefile.options.cache - ifeq ($(PLATFORM),) - PLATFORM=PM3RDV4 - else - ${info using saved PLATFORM: '$(PLATFORM)'} - endif - ifneq ($(PLATFORM_EXTRAS),) - ${info using saved PLATFORM_EXTRAS: '$(PLATFORM_EXTRAS)'} - endif - ifneq ($(STANDALONE),) - ${info using saved STANDALONE: '$(STANDALONE)'} - endif include ../common/Makefile.hal - $(info ===================================================================) - $(info Platform name: $(PLTNAME)) - $(info PLATFORM: $(PLATFORM)) - $(info PLATFORM_EXTRAS: $(PLATFORM_EXTRAS)) - $(info Included options: $(PLATFORM_DEFS_INFO)) - $(info Standalone mode: $(PLATFORM_DEFS_INFO_STANDALONE)) - $(info ===================================================================) - # detect if there were changes in the platform definitions, requiring a clean -ifeq ($(PLATFORM_CHANGED), true) - $(error platform definitions have been changed, please "make clean" at the root of the project) -endif + ifeq ($(PLATFORM_CHANGED), true) + $(error platform definitions have been changed, please "make clean" at the root of the project) + endif endif #remove one of the following defines and comment out the relevant line diff --git a/common/Makefile.hal b/common/Makefile.hal index 98ad81da0..5faf8a56d 100644 --- a/common/Makefile.hal +++ b/common/Makefile.hal @@ -1,3 +1,6 @@ +# Default platform if no platform specified +PLATFORM?=PM3RDV4 + define KNOWN_DEFINITIONS Known definitions: @@ -172,3 +175,11 @@ else ifneq ($(PLATFORM_EXTRAS), $(CACHED_PLATFORM_EXTRAS)) else ifneq ($(PLATFORM_DEFS), $(CACHED_PLATFORM_DEFS)) PLATFORM_CHANGED=true endif + +$(info ===================================================================) +$(info Platform name: $(PLTNAME)) +$(info PLATFORM: $(PLATFORM)) +$(info PLATFORM_EXTRAS: $(PLATFORM_EXTRAS)) +$(info Included options: $(PLATFORM_DEFS_INFO)) +$(info Standalone mode: $(PLATFORM_DEFS_INFO_STANDALONE)) +$(info ===================================================================)