makefile: allow override of install paths

This commit is contained in:
Philippe Teuwen 2019-08-23 21:07:20 +02:00
commit e0cdb5d7a7
2 changed files with 12 additions and 0 deletions

View file

@ -15,6 +15,12 @@ FALSE = false
CFLAGS ?= -Wall -Werror -O3
CFLAGS += $(MYDEFS) $(MYCFLAGS) $(MYINCLUDES)
ifneq (,$(PM3_BIN_PATH))
CFLAGS += -DPM3_BIN_PATH=\"$(PM3_BIN_PATH)\"
endif
ifneq (,$(PM3_SHARE_PATH))
CFLAGS += -DPM3_SHARE_PATH=\"$(PM3_SHARE_PATH)\"
endif
platform = $(shell uname)

View file

@ -66,6 +66,12 @@ INCLUDES_CLIENT = -I. -I../include -I../common -Iuart $(LIBS)
CFLAGS ?= -Wall -Werror -g -O3
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
PM3CFLAGS = $(CFLAGS) -std=c99 -D_ISOC99_SOURCE $(INCLUDES_CLIENT)
ifneq (,$(PM3_BIN_PATH))
PM3CFLAGS += -DPM3_BIN_PATH=\"$(PM3_BIN_PATH)\"
endif
ifneq (,$(PM3_SHARE_PATH))
PM3CFLAGS += -DPM3_SHARE_PATH=\"$(PM3_SHARE_PATH)\"
endif
ifneq (,$(findstring MINGW,$(platform)))
PM3CFLAGS += -mno-ms-bitfields
endif