simplify makefile

This commit is contained in:
Philippe Teuwen 2019-06-01 22:49:28 +02:00
parent 1cddc6919a
commit 3bf26f2808
3 changed files with 16 additions and 46 deletions

View file

@ -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

View file

@ -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

View file

@ -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 ===================================================================)