Add Makefile.defs with common defs

This commit is contained in:
Philippe Teuwen 2019-08-30 22:10:06 +02:00
commit 3245260c00
5 changed files with 72 additions and 90 deletions

View file

@ -6,48 +6,34 @@
# Common makefile functions for all platforms
#-----------------------------------------------------------------------------
# This new makefile replaces the previous Makefile/Makefile.linux
# with as much common code for both environments as possible.
# Following is a short OS detection to set up variables, all the
# remaining Makefile should be portable and only depend on these
# variables
#
ifneq ($(V),1)
Q?=@
endif
# To see full command lines, use make V=1
# Make sure that all is the default target
# (The including Makefile still needs to define what 'all' is)
all:
platform = $(shell uname)
PREFIX?=/usr/local
INSTALLFWRELPATH = /share/proxmark3/firmware/
# This Makefile might have been called from various subdirs, trying to find our Makefile.defs
ifeq ($(DEFSBEENHERE),)
-include Makefile.defs
endif
ifeq ($(DEFSBEENHERE),)
-include ../Makefile.defs
endif
ifeq ($(DEFSBEENHERE),)
-include ../../Makefile.defs
endif
ifeq ($(DEFSBEENHERE),)
$(error Can't find Makefile.defs)
endif
CROSS ?= arm-none-eabi-
CC = $(CROSS)gcc
AS = $(CROSS)as
LD = $(CROSS)ld
OBJCOPY = $(CROSS)objcopy
GZIP=gzip
MV=mv
OBJDIR = obj
INCLUDE = -I../include -I../common_arm -I../common_fpga -I../common -I.
TAR=tar
TARFLAGS = -C .. -rvf
RM=rm -f
RMDIR=rm -rf
CP=cp -a
MKDIR=mkdir -p
PATHSEP=/
DETECTED_OS=$(platform)
# Also search prerequisites in the common directory (for usb.c), the fpga directory (for fpga.bit), and the zlib directory
VPATH = . ../common_arm ../common ../common/crapto1 ../common/mbedtls ../common/zlib ../fpga ../armsrc/Standalone