Skip to content

Commit

Permalink
Added option to Makefile to build w/o Docker
Browse files Browse the repository at this point in the history
Refers to the discussion in apple#23.

Signed-off-by: Clovis Durand <[email protected]>
  • Loading branch information
Clovel committed Feb 3, 2020
1 parent 875f050 commit 40163c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ endif
TARGET ?= $(HOST)
BUILD_TYPE ?= Debug
MAKE := make -f Build/Makefile -j $(shell $(NPROC))
DOCKER := docker
DOCKER_EXE := docker
DOCKER ?= 1

DOCKERFILE := Build/Docker/Dockerfile
ifeq ($(TARGET),Raspi)
DOCKERFILE := Build/Docker/Dockerfile.Raspi
endif

ENABLE_TTY =
MAKE_DOCKER = $(DOCKER) build - < $(DOCKERFILE) | tee /dev/stderr | grep "Successfully built" | cut -d ' ' -f 3
RUN = $(DOCKER) run \
MAKE_DOCKER = $(DOCKER_EXE) build - < $(DOCKERFILE) | tee /dev/stderr | grep "Successfully built" | cut -d ' ' -f 3
RUN = $(DOCKER_EXE) run \
-e APPS \
-e BUILD_TYPE \
-e HOST \
Expand All @@ -49,13 +50,14 @@ ifneq ($(TARGET),Darwin)
ifneq (,$(wildcard /.dockerenv))
# If we are already running inside docker
MAKE := $(MAKE)
else ifeq ($(DOCKER),0)
MAKE := $(MAKE)
else
# Else run make inside docker
MAKE := $(RUN) $(MAKE)
endif
endif


define make_target
$(1):
@$(2) $$@
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ make PROTOCOLS=\<protocol\> | Space delimited protocols supported by the ap
make TARGET=\<platform\> | Build for a given target platform:<br><ul><li>`Darwin`</li><li>`Linux`</li><li>`Raspi`</li></ul> | Build for the host Platform
make USE_HW_AUTH=\<enable\> | Build with hardware authentication enabled: <br><ul><li>`0` - Disable</li><li>`1` - Enable</li></ul> | Disabled
make USE_NFC=\<enable\> | Build with NFC enabled:<br><ul><li>`0` - Disable</li><li>`1` - Enable</li></ul> | Disabled
make DOCKER=\<enable\> | Build with or without Docker: <br><ul><li>`1` - Enable Docker during compilaton</li><li>`0` - Disable Docker during compilation</li></ul> | `1` - Docker is enabled

0 comments on commit 40163c3

Please sign in to comment.