Add Makefile.defs with common defs

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

View file

@ -1,14 +1,5 @@
# Hide full compilation line:
ifneq ($(V),1)
Q?=@
endif
# To see full command lines, use make V=1
CP = cp -a
GZIP=gzip
MKDIR = mkdir -p
RM = rm -f
RMDIR = rm -rf
include Makefile.defs
-include Makefile.platform
-include .Makefile.options.cache
include common_arm/Makefile.hal

42
Makefile.defs Normal file
View file

@ -0,0 +1,42 @@
# Hide full compilation line:
ifneq ($(V),1)
Q?=@
endif
# To see full command lines, use make V=1
# been here
DEFSBEENHERE = true
CP = cp -a
GZIP = gzip
MKDIR = mkdir -p
RM = rm -f
RMDIR = rm -rf
MV = mv
TOUCH = touch
FALSE = false
TAR = tar
TARFLAGS ?= -v --ignore-failed-read -r
TARFLAGS += -C .. -f
CROSS ?= arm-none-eabi-
CC = gcc
CXX = g++
LD = g++
PATHSEP=/
PREFIX ?= /usr/local
INSTALLBINRELPATH = /bin/
INSTALLSHARERELPATH = /share/proxmark3/
INSTALLFWRELPATH = /share/proxmark3/firmware/
INSTALLTOOLSRELPATH = /share/proxmark3/tools/
platform = $(shell uname)
DETECTED_OS=$(platform)
ifeq ($(platform),Darwin)
AR= /usr/bin/ar rcs
RANLIB= /usr/bin/ranlib
else
AR= ar rcs
RANLIB= ranlib
endif

View file

@ -1,36 +1,19 @@
# Hide full compilation line:
ifneq ($(V),1)
Q?=@
# 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
# To see full command lines, use make V=1
INSTALLBINRELPATH = /bin/
INSTALLTOOLSRELPATH = /share/proxmark3/tools/
CC = gcc
LD = gcc
RM = rm -f
MV = mv
CP = cp -a
MKDIR = mkdir -p
TOUCH = touch
FALSE = false
CFLAGS ?= -Wall -Werror -O3
CFLAGS += $(MYDEFS) $(MYCFLAGS) $(MYINCLUDES)
PREFIX ?= /usr/local
platform = $(shell uname)
ifeq ($(platform),Darwin)
AR= /usr/bin/ar rcs
RANLIB= /usr/bin/ranlib
else
AR= ar rcs
RANLIB= ranlib
endif
RM= rm -f
RMDIR= rm -rf
vpath %.c $(MYSRCPATHS)

View file

@ -9,34 +9,14 @@
# Add -DNOFORCE to disable the -F switch
# Add -DPRESETS to compile with preset models (edit config.h)
# Hide full compilation line:
ifneq ($(V),1)
Q?=@
endif
# To see full command lines, use make V=1
# Must be called before any Makefile include
ROOT_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
include ../Makefile.defs
INSTALLBINRELPATH = /bin/
INSTALLSHARERELPATH = /share/proxmark3/
INSTALLBIN = proxmark3 proxmark3-flasher
INSTALLSHARE = lualibs luascripts resources dictionaries
CC = gcc
CXX = g++
LD = g++
TAR = tar
TARFLAGS ?= -v --ignore-failed-read -r
TARFLAGS += -C .. -f
RM = rm -f
RMDIR= rm -rf
MKDIR = mkdir -p
MV = mv
TOUCH = touch
FALSE = false
CP=cp -a
platform = $(shell uname)
ROOT_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
VPATH = ../common uart
vpath %.dic dictionaries
OBJDIR = obj

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