Skip to content

Commit

Permalink
Rename make folder to get rid of build error.
Browse files Browse the repository at this point in the history
When trying to build firmware with current directory in PATH environment
it scans for make command and generates "Permission denied" error in
case if current directory in PATH precedes /usr/bin/ directory.In my
case it was caused by incorrect pyenv init script.

Rename make folder to avoid errors like this.
  • Loading branch information
avida committed Jun 11, 2023
1 parent 16776dc commit bd301e5
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
id: cache-toolchain
with:
path: tools
key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }}
key: ${{ runner.os }}-${{ hashFiles('mk/tools.mk') }}

- name: Download and install toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
id: cache-toolchain
with:
path: tools
key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }}
key: ${{ runner.os }}-${{ hashFiles('mk/tools.mk') }}

- name: Hydrate configuration
id: get-config
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ README.pdf
/tools/
/build/
# local changes only
make/local.mk
mk/local.mk

# artefacts for VisualGDB (running in Visual Studio)
mcu.mak
Expand Down
29 changes: 15 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,24 @@ INCLUDE_DIRS := $(SRC_DIR) \
$(ROOT)/src/main/target \
$(ROOT)/src/main/startup
LINKER_DIR := $(ROOT)/src/link
MAKE_SCRIPT_DIR := $(ROOT)/mk

## V : Set verbosity level based on the V= parameter
## V=0 Low
## V=1 High
include $(ROOT)/make/build_verbosity.mk
include $(MAKE_SCRIPT_DIR)/build_verbosity.mk

# Build tools, so we all share the same versions
# import macros common to all supported build systems
include $(ROOT)/make/system-id.mk
include $(MAKE_SCRIPT_DIR)/system-id.mk

# developer preferences, edit these at will, they'll be gitignored
ifneq ($(wildcard $(ROOT)/make/local.mk),)
include $(ROOT)/make/local.mk
ifneq ($(wildcard $(MAKE_SCRIPT_DIR)/local.mk),)
include $(MAKE_SCRIPT_DIR)/local.mk
endif

# pre-build sanity checks
include $(ROOT)/make/checks.mk
include $(MAKE_SCRIPT_DIR)/checks.mk

# basic target list
BASE_TARGETS := $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(ROOT)/src/main/target/*/target.mk)))))
Expand All @@ -97,10 +98,10 @@ DIRECTORIES := $(DL_DIR) $(TOOLS_DIR)
export RM := rm

# import macros that are OS specific
include $(ROOT)/make/$(OSFAMILY).mk
include $(MAKE_SCRIPT_DIR)/$(OSFAMILY).mk

# include the tools makefile
include $(ROOT)/make/tools.mk
include $(MAKE_SCRIPT_DIR)/tools.mk

# Search path for sources
VPATH := $(SRC_DIR):$(SRC_DIR)/startup
Expand All @@ -115,7 +116,7 @@ FC_VER_PATCH := $(shell grep " FC_VERSION_PATCH" src/main/build/version.h | awk
FC_VER := $(FC_VER_MAJOR).$(FC_VER_MINOR).$(FC_VER_PATCH)

# import config handling
include $(ROOT)/make/config.mk
include $(MAKE_SCRIPT_DIR)/config.mk

ifeq ($(CONFIG),)
ifeq ($(TARGET),)
Expand Down Expand Up @@ -157,8 +158,8 @@ OPTIMISE_SIZE := -Os
LTO_FLAGS := $(OPTIMISATION_BASE) $(OPTIMISE_SPEED)
endif

VPATH := $(VPATH):$(ROOT)/make/mcu
VPATH := $(VPATH):$(ROOT)/make
VPATH := $(VPATH):$(MAKE_SCRIPT_DIR)/mcu
VPATH := $(VPATH):$(MAKE_SCRIPT_DIR)

# start specific includes
ifeq ($(TARGET_MCU),)
Expand All @@ -175,10 +176,10 @@ ifneq ($(CONFIG),)
TARGET_FLAGS := $(TARGET_FLAGS) -DUSE_CONFIG
endif

include $(ROOT)/make/mcu/$(TARGET_MCU_FAMILY).mk
include $(MAKE_SCRIPT_DIR)/mcu/$(TARGET_MCU_FAMILY).mk

# openocd specific includes
include $(ROOT)/make/openocd.mk
include $(MAKE_SCRIPT_DIR)/openocd.mk

# Configure default flash sizes for the targets (largest size specified gets hit first) if flash not specified already.
ifeq ($(TARGET_FLASH_SIZE),)
Expand Down Expand Up @@ -208,7 +209,7 @@ INCLUDE_DIRS := $(INCLUDE_DIRS) \

VPATH := $(VPATH):$(TARGET_DIR)

include $(ROOT)/make/source.mk
include $(MAKE_SCRIPT_DIR)/source.mk

###############################################################################
# Things that might need changing to use different tools
Expand Down Expand Up @@ -578,7 +579,7 @@ version:
@echo $(FC_VER)

## help : print this help message and exit
help: Makefile make/tools.mk
help: Makefile mk/tools.mk
@echo ""
@echo "Makefile for the $(FORKNAME) firmware"
@echo ""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion make/tools.mk → mk/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ else ifeq (,$(filter %_install test% clean% %-print checks help configs, $(MAKEC
ifeq ($(GCC_VERSION),)
$(error **ERROR** arm-none-eabi-gcc not in the PATH. Run 'make arm_sdk_install' to install automatically in the tools folder of this repo)
else ifneq ($(GCC_VERSION), $(GCC_REQUIRED_VERSION))
$(error **ERROR** your arm-none-eabi-gcc is '$(GCC_VERSION)', but '$(GCC_REQUIRED_VERSION)' is expected. Override with 'GCC_REQUIRED_VERSION' in make/local.mk or run 'make arm_sdk_install' to install the right version automatically in the tools folder of this repo)
$(error **ERROR** your arm-none-eabi-gcc is '$(GCC_VERSION)', but '$(GCC_REQUIRED_VERSION)' is expected. Override with 'GCC_REQUIRED_VERSION' in mk/local.mk or run 'make arm_sdk_install' to install the right version automatically in the tools folder of this repo)
endif

# ARM tookchain is in the path, and the version is what's required.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ROOT = ../..
OBJECT_DIR = ../../obj/test
TARGET_DIR = $(USER_DIR)/target

include $(ROOT)/make/system-id.mk
include $(ROOT)/mk/system-id.mk

VPATH := $(VPATH):$(USER_DIR):$(TEST_DIR)

Expand Down Expand Up @@ -592,7 +592,7 @@ GTEST_HEADERS = $(GTEST_DIR)/inc/gtest/*.h
## V : Set verbosity level based on the V= parameter
## V=0 Low
## V=1 High
include ../../make/build_verbosity.mk
include ../../mk/build_verbosity.mk

# House-keeping build targets.

Expand Down

0 comments on commit bd301e5

Please sign in to comment.