Sujet : Re: Improving build system
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.arch.embeddedDate : 16. May 2025, 16:20:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1007l3p$3qs5b$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 16/05/2025 15:45, pozz wrote:
Il 14/05/2025 11:03, David Brown ha scritto:
On 13/05/2025 17:57, pozz wrote:
[...]
3.
>
Makefiles can be split up. Use "include" - and remember that you can do so using macros. In my makefile setups, I have a file "host.mk" that is used to identify the build host, then pull in a file that is specific to the host:
>
# This is is for identifying host computer to get the paths right
>
ifeq ($(OS),Windows_NT)
# We are on a Windows machine
host_os := windows
host := $(COMPUTERNAME)
else
# Linux machine
host_os := linux
host := $(shell hostname)
endif
>
ifeq "$(call file-exists,makes/host_$(host).mk)" "1"
include makes/host_$(host).mk
else
$(error No host makefile host_$(host).mk found)
endif
>
Then I have files like "host_xxx.mk" for a computer named "xxx", containing things like :
>
toolchain_path := /opt/gcc-arm-none-eabi-10-2020-q4-major/bin/
>
or
>
toolchain_path := c:/micros/gcc-arm-none-eabi-10_2020-q4-major/bin/
>
>
All paths to compilers and other build-related programs are specified in these files. The only things that are taken from the OS path are standard and common programs that do not affect the resulting binary files.
Regarding this point, I tried to set
toolchain_path := c:\msys64\mingw64\bin
What happens when you use the correct path?
toolchain_path := c:/msys64/mingw64/bin/
(Note the trailing slash - or you can add it when you use the macro.)
Strive to get rid of all the Windows idiosyncrasies here.
make, gcc and all the other relevant tools here are from a *nix background. Use them with that in mind and it will all be smoother.