2018-08-16 17:54:31 -05:00
|
|
|
# SONiC make file
|
2016-08-04 12:39:33 -05:00
|
|
|
|
2020-12-24 23:55:20 -06:00
|
|
|
NOJESSIE ?= 1
|
2020-02-02 14:04:18 -06:00
|
|
|
NOSTRETCH ?= 0
|
2016-10-31 23:50:59 -05:00
|
|
|
|
2021-08-12 01:04:36 -05:00
|
|
|
ifeq ($(NOJESSIE),0)
|
|
|
|
BUILD_JESSIE=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(NOSTRETCH),0)
|
|
|
|
BUILD_STRETCH=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
PLATFORM_PATH := platform/$(if $(PLATFORM),$(PLATFORM),$(CONFIGURED_PLATFORM))
|
|
|
|
PLATFORM_CHECKOUT := platform/checkout
|
|
|
|
PLATFORM_CHECKOUT_FILE := $(PLATFORM_CHECKOUT)/$(PLATFORM).ini
|
|
|
|
PLATFORM_CHECKOUT_CMD := $(shell if [ -f $(PLATFORM_CHECKOUT_FILE) ]; then PLATFORM_PATH=$(PLATFORM_PATH) j2 $(PLATFORM_CHECKOUT)/template.j2 $(PLATFORM_CHECKOUT_FILE); fi)
|
2022-12-23 04:52:19 -06:00
|
|
|
MAKE_WITH_RETRY := ./scripts/run_with_retry $(MAKE)
|
2021-08-12 01:04:36 -05:00
|
|
|
|
2016-12-05 13:12:19 -06:00
|
|
|
%::
|
2018-08-16 17:54:31 -05:00
|
|
|
@echo "+++ --- Making $@ --- +++"
|
2019-05-27 17:50:51 -05:00
|
|
|
ifeq ($(NOJESSIE), 0)
|
2022-12-23 04:52:19 -06:00
|
|
|
$(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) -f Makefile.work jessie
|
2017-09-22 02:57:23 -05:00
|
|
|
endif
|
2020-02-02 14:04:18 -06:00
|
|
|
ifeq ($(NOSTRETCH), 0)
|
2022-12-23 04:52:19 -06:00
|
|
|
$(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=stretch -f Makefile.work stretch
|
2020-02-02 14:04:18 -06:00
|
|
|
endif
|
2022-12-23 04:52:19 -06:00
|
|
|
$(MAKE_WITH_RETRY) BLDENV=buster -f Makefile.work $@
|
2016-08-04 12:39:33 -05:00
|
|
|
|
2019-05-27 17:50:51 -05:00
|
|
|
jessie:
|
2018-08-16 17:54:31 -05:00
|
|
|
@echo "+++ Making $@ +++"
|
2019-05-27 17:50:51 -05:00
|
|
|
ifeq ($(NOJESSIE), 0)
|
|
|
|
make -f Makefile.work jessie
|
2018-08-16 17:54:31 -05:00
|
|
|
endif
|
2017-12-21 13:15:06 -06:00
|
|
|
|
2020-02-02 14:04:18 -06:00
|
|
|
stretch:
|
|
|
|
@echo "+++ Making $@ +++"
|
|
|
|
ifeq ($(NOSTRETCH), 0)
|
|
|
|
make -f Makefile.work stretch
|
|
|
|
endif
|
2020-02-02 14:03:34 -06:00
|
|
|
|
2020-12-09 16:13:33 -06:00
|
|
|
init:
|
|
|
|
@echo "+++ Making $@ +++"
|
|
|
|
make -f Makefile.work $@
|
|
|
|
|
2021-08-12 01:04:36 -05:00
|
|
|
#
|
|
|
|
# Function to invoke target $@ in Makefile.work with proper BLDENV
|
|
|
|
#
|
|
|
|
define make_work
|
2018-08-16 17:54:31 -05:00
|
|
|
@echo "+++ Making $@ +++"
|
2021-08-12 01:04:36 -05:00
|
|
|
$(if $(BUILD_JESSIE),make -f Makefile.work $@,)
|
|
|
|
$(if $(BUILD_STRETCH),BLDENV=stretch make -f Makefile.work $@,)
|
2020-02-02 14:04:18 -06:00
|
|
|
BLDENV=buster make -f Makefile.work $@
|
2021-08-12 01:04:36 -05:00
|
|
|
endef
|
|
|
|
|
|
|
|
.PHONY: $(PLATFORM_PATH)
|
|
|
|
|
|
|
|
$(PLATFORM_PATH):
|
|
|
|
@echo "+++ Cheking $@ +++"
|
|
|
|
$(PLATFORM_CHECKOUT_CMD)
|
|
|
|
|
|
|
|
configure : $(PLATFORM_PATH)
|
|
|
|
$(call make_work, $@)
|
|
|
|
|
|
|
|
clean reset showtag sonic-slave-build sonic-slave-bash :
|
|
|
|
$(call make_work, $@)
|
2020-12-21 01:31:10 -06:00
|
|
|
|
|
|
|
# Freeze the versions, see more detail options: scripts/versions_manager.py freeze -h
|
|
|
|
freeze:
|
|
|
|
@scripts/versions_manager.py freeze $(FREEZE_VERSION_OPTIONS)
|