WIP.. TARGET => MACHINE
TARGET is also GNU make terminology.. use MACHINE as this matches the terminology of OpenEmbedded..
This commit is contained in:
parent
de5bcbc362
commit
8d353ae692
61
Makefile
61
Makefile
|
@ -1,5 +1,18 @@
|
||||||
# makefile to set-up the environment for building...
|
# makefile to set-up the environment for building...
|
||||||
|
|
||||||
|
# This is probably only working with GNU make. The file is structured
|
||||||
|
# to have variables in the beginning, some helper functions, then so
|
||||||
|
# implicit rules and in the end targets that invoke them all.
|
||||||
|
#
|
||||||
|
# If you need to change sysmocom release or poky base branch then the
|
||||||
|
# two variables need to be changed.
|
||||||
|
# If you add a machine then MACHINES need to be adjusted and a new config
|
||||||
|
# in cfg/NAME/10_NAME needs to be created.
|
||||||
|
#
|
||||||
|
# Implicit rules: I used WILDCARD-action for the rules and then get the
|
||||||
|
# name of the rule from $@ in the rule itself or % when still being in
|
||||||
|
# the dependency list.
|
||||||
|
|
||||||
|
|
||||||
# Make everything more verbose by V=1. Taken from kbuild
|
# Make everything more verbose by V=1. Taken from kbuild
|
||||||
ifeq ("$(origin V)", "command line")
|
ifeq ("$(origin V)", "command line")
|
||||||
|
@ -12,8 +25,16 @@ endif
|
||||||
SYSMOCOM_RELEASE=201705
|
SYSMOCOM_RELEASE=201705
|
||||||
POKY_RELEASE=pyro
|
POKY_RELEASE=pyro
|
||||||
REPOS=poky meta-telephony meta-sysmocom-bsp meta-qt5 meta-sysmocom-bsp
|
REPOS=poky meta-telephony meta-sysmocom-bsp meta-qt5 meta-sysmocom-bsp
|
||||||
TARGETS=sysmobts sysmocom-apu2 sysmocom-alix
|
MACHINES=sysmobts sysmocom-apu2 sysmocom-alix
|
||||||
|
FEED_NAME=$(SYSMOCOM_RELEASE)-testing
|
||||||
|
|
||||||
|
# The default targets to pick depending on machine
|
||||||
|
BUILD_TARGET_sysmobts = "meta-toolchain-osmo task-sysmocom-feed sysmocom-nitb-image sysmocom-nitb-rauc-image image-rauc-rescue-initramfs image-rauc-slot-initramfs image-rauc-ubi"
|
||||||
|
BUILD_TARGET_sysmocom-apu2 = "core-image-minimal-initramfs meta-toolchain-osmo task-sysmocom-feed sysmocom-nitb-image core-image-minimal-initramfs"
|
||||||
|
BUILD_TARGET_sysmocom-alix = "core-image-minimal-initramfs meta-toolchain-osmo task-sysmocom-feed sysmocom-nitb-image core-image-minimal-initramfs"
|
||||||
|
|
||||||
|
# Pick the one depending on $@
|
||||||
|
BUILD_TARGETS=
|
||||||
|
|
||||||
#
|
#
|
||||||
usage:
|
usage:
|
||||||
|
@ -33,12 +54,12 @@ help:
|
||||||
@echo " upload-all - Upload all targets"
|
@echo " upload-all - Upload all targets"
|
||||||
@echo ' install-ssh-config - Install Host to $$HOME/.ssh/config'
|
@echo ' install-ssh-config - Install Host to $$HOME/.ssh/config'
|
||||||
@echo "Board specific targets:"
|
@echo "Board specific targets:"
|
||||||
@$(foreach target, $(TARGETS), \
|
@$(foreach machine, $(MACHINES), \
|
||||||
printf " %-16s - Configure build directory\\n" $(target)-setup;)
|
printf " %-16s - Configure build directory\\n" $(machine)-setup;)
|
||||||
@$(foreach target, $(TARGETS), \
|
@$(foreach machine, $(MACHINES), \
|
||||||
printf " %-16s - Configure build directory\\n" $(target)-build;)
|
printf " %-16s - Configure build directory\\n" $(machine)-build;)
|
||||||
@$(foreach target, $(TARGETS), \
|
@$(foreach machine, $(MACHINES), \
|
||||||
printf " %-16s - Configure build directory\\n" $(target)-upload;)
|
printf " %-16s - Configure build directory\\n" $(machine)-upload;)
|
||||||
@echo "Available variables:"
|
@echo "Available variables:"
|
||||||
@echo " V=1 - Enable verbose command output"
|
@echo " V=1 - Enable verbose command output"
|
||||||
@echo " SYSMOCOM_RELEASE=name - Pick branch during clone"
|
@echo " SYSMOCOM_RELEASE=name - Pick branch during clone"
|
||||||
|
@ -49,6 +70,8 @@ help:
|
||||||
update: $(foreach repo, $(REPOS), $(repo)-update)
|
update: $(foreach repo, $(REPOS), $(repo)-update)
|
||||||
|
|
||||||
# helper rules
|
# helper rules
|
||||||
|
CUR_MACHINE=""
|
||||||
|
|
||||||
|
|
||||||
## Create a new directory
|
## Create a new directory
|
||||||
git:
|
git:
|
||||||
|
@ -93,8 +116,24 @@ build.%: | git/poky
|
||||||
%-setup: | build.$(subst -setup,,%) git/poky
|
%-setup: | build.$(subst -setup,,%) git/poky
|
||||||
@echo "Please place proprietary firmware into the downloads directory."
|
@echo "Please place proprietary firmware into the downloads directory."
|
||||||
|
|
||||||
# Create all build directories
|
# Start a build..
|
||||||
setup-all: | $(foreach target, $(TARGETS), $(target)-setup)
|
%-build: | build.$(subst -build,,%) git/poky
|
||||||
|
(. git/poky/oe-init-build-env build.$(subst -build $@) && bitbake $(BUILD_TARGETS)
|
||||||
|
|
||||||
|
%-upload: | build.$(subst -upload,,%) git/poky
|
||||||
|
echo $(CUR_MACHINE)
|
||||||
|
#$(exit foo)
|
||||||
|
#(. git/poky/oe-init-build-env build.$(subst -build $@) && ../scripts/upload-build.sh $(CUR_MACHINE) $(FEED_NAME)
|
||||||
|
|
||||||
|
# Create all build directories, build everything, upload everything, clean everything
|
||||||
|
setup-all: | $(foreach machine, $(MACHINES), $(machine)-setup)
|
||||||
|
|
||||||
|
build-all: | $(foreach machine, $(MACHINES), $(machine)-build)
|
||||||
|
|
||||||
|
upload-all: | $(foreach machine, $(MACHINES), $(machine)-upload)
|
||||||
|
|
||||||
|
clean-all: | $(foreach machine, $(MACHINES), $(machine)-clean)
|
||||||
|
|
||||||
|
|
||||||
install-ssh-config: | $(HOME)/.ssh
|
install-ssh-config: | $(HOME)/.ssh
|
||||||
ifndef SSH_HOST
|
ifndef SSH_HOST
|
||||||
|
@ -112,5 +151,5 @@ endif
|
||||||
@echo " AddressFamily = inet" >> $(HOME)/.ssh/config
|
@echo " AddressFamily = inet" >> $(HOME)/.ssh/config
|
||||||
@echo " User = $(SSH_USER)" >> $(HOME)/.ssh/config
|
@echo " User = $(SSH_USER)" >> $(HOME)/.ssh/config
|
||||||
# Target classification
|
# Target classification
|
||||||
.PHONY: update
|
.PHONY: update setup-all install-ssh-config
|
||||||
.SECONDARY: $(foreach repo, $(REPOS), git/$(repo)) $(foreach target, $(TARGETS), build.$(target))
|
.SECONDARY: $(foreach repo, $(REPOS), git/$(repo)) $(foreach machine, $(MACHINES), build.$(machine))
|
||||||
|
|
Loading…
Reference in New Issue