# Makefile - Main build script for sbc-harness project # # Copyright (C) 2024 Luke T. Shumaker # SPDX-License-Identifier: AGPL-3.0-or-later linux.git = $(HOME)/src/github.com/torvalds/linux all: build .PHONY: all .NOTINTERMEDIATE: .DELETE_ON_ERROR: ################################################################################ generate/files = generate/files += 3rd-party/linux-errno.txt 3rd-party/linux-errno.txt: %: %.gen ./$< $(linux.git) generate/files += lib9p/include/lib9p/linux-errno.h lib9p/include/lib9p/linux-errno.h: %: %.gen 3rd-party/linux-errno.txt ./$^ >$@ generate/files += lib9p/9p.generated.c lib9p/include/lib9p/9p.generated.h lib9p/9p.generated.c lib9p/include/lib9p/9p.generated.h &: lib9p/idl.gen lib9p/idl/*.9p ./$^ generate/files += libusb/include/libusb/tusb_helpers.h 3rd-party/MS-LCID.pdf 3rd-party/MS-LCID.txt libusb/include/libusb/tusb_helpers.h 3rd-party/MS-LCID.pdf 3rd-party/MS-LCID.txt &: libusb/include/libusb/tusb_helpers.h.gen ./$^ ################################################################################ platforms := $(shell sed -nE 's/if *\(PICO_PLATFORM STREQUAL "(.*)"\)/\1/p' cmd/*/CMakeLists.txt) build: $(foreach p,$(platforms),build/$p/build) .PHONY: build $(foreach p,$(platforms),build/$p/Makefile): build/%/Makefile: mkdir -p $(@D) && cd $(@D) && cmake -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=$* ../.. $(foreach p,$(platforms),build/$p/build): build/%/build: build/%/Makefile $(MAKE) -C $($@.tmp if ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi -include .sources.mk sources_all := $(foreach v,$(filter sources_%,$(.VARIABLES)),$($v)) # lint ############# get_dscname = sed -n '1,3{ /^\#!/d; /^