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
|
2022-12-01 11:26:46 -06:00
|
|
|
NOSTRETCH ?= 1
|
2021-06-30 14:45:40 -05:00
|
|
|
NOBUSTER ?= 0
|
2021-06-30 14:45:40 -05:00
|
|
|
NOBULLSEYE ?= 0
|
2023-06-26 11:14:51 -05:00
|
|
|
NOBOOKWORM ?= 1
|
2016-10-31 23:50:59 -05:00
|
|
|
|
2022-10-04 16:13:40 -05:00
|
|
|
override Q := @
|
|
|
|
ifeq ($(QUIET),n)
|
|
|
|
override Q :=
|
|
|
|
endif
|
|
|
|
override SONIC_OVERRIDE_BUILD_VARS += $(SONIC_BUILD_VARS)
|
|
|
|
override SONIC_OVERRIDE_BUILD_VARS += Q=$(Q)
|
|
|
|
export Q SONIC_OVERRIDE_BUILD_VARS
|
|
|
|
|
2021-08-05 20:11:54 -05:00
|
|
|
ifeq ($(NOJESSIE),0)
|
|
|
|
BUILD_JESSIE=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(NOSTRETCH),0)
|
|
|
|
BUILD_STRETCH=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(NOBUSTER),0)
|
|
|
|
BUILD_BUSTER=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(NOBULLSEYE),0)
|
|
|
|
BUILD_BULLSEYE=1
|
|
|
|
endif
|
|
|
|
|
2023-06-26 11:14:51 -05:00
|
|
|
ifeq ($(NOBOOKWORM),0)
|
|
|
|
BUILD_BOOKWORM=1
|
|
|
|
endif
|
|
|
|
|
2021-08-05 20:11:54 -05:00
|
|
|
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-18 22:18:36 -06:00
|
|
|
MAKE_WITH_RETRY := ./scripts/run_with_retry $(MAKE)
|
2021-08-05 20:11:54 -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-18 22:18:36 -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-18 22:18:36 -06:00
|
|
|
$(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=stretch -f Makefile.work stretch
|
2020-02-02 14:04:18 -06:00
|
|
|
endif
|
2021-06-30 14:45:40 -05:00
|
|
|
ifeq ($(NOBUSTER), 0)
|
2022-12-18 22:18:36 -06:00
|
|
|
$(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=buster -f Makefile.work buster
|
2021-06-30 14:45:40 -05:00
|
|
|
endif
|
|
|
|
ifeq ($(NOBULLSEYE), 0)
|
2022-12-18 22:18:36 -06:00
|
|
|
$(MAKE_WITH_RETRY) BLDENV=bullseye -f Makefile.work $@
|
2023-06-26 11:14:51 -05:00
|
|
|
endif
|
|
|
|
ifeq ($(NOBOOKWORM), 0)
|
|
|
|
$(MAKE_WITH_RETRY) BLDENV=bullseye -f Makefile.work $@
|
2021-06-30 14:45:40 -05:00
|
|
|
endif
|
2022-10-04 16:13:40 -05:00
|
|
|
BLDENV=bullseye $(MAKE) -f Makefile.work docker-cleanup
|
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)
|
2022-10-04 16:13:40 -05:00
|
|
|
$(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)
|
2022-10-04 16:13:40 -05:00
|
|
|
$(MAKE) -f Makefile.work stretch
|
2020-02-02 14:04:18 -06:00
|
|
|
endif
|
2020-02-02 14:03:34 -06:00
|
|
|
|
2021-06-30 14:45:40 -05:00
|
|
|
buster:
|
|
|
|
@echo "+++ Making $@ +++"
|
|
|
|
ifeq ($(NOBUSTER), 0)
|
2022-10-04 16:13:40 -05:00
|
|
|
$(MAKE) -f Makefile.work buster
|
2021-06-30 14:45:40 -05:00
|
|
|
endif
|
|
|
|
|
2020-12-09 16:13:33 -06:00
|
|
|
init:
|
|
|
|
@echo "+++ Making $@ +++"
|
2022-10-04 16:13:40 -05:00
|
|
|
$(MAKE) -f Makefile.work $@
|
2020-12-09 16:13:33 -06:00
|
|
|
|
2021-08-05 20:11:54 -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 $@ +++"
|
2022-10-04 16:13:40 -05:00
|
|
|
$(if $(BUILD_JESSIE),$(MAKE) -f Makefile.work $@,)
|
|
|
|
$(if $(BUILD_STRETCH),BLDENV=stretch $(MAKE) -f Makefile.work $@,)
|
|
|
|
$(if $(BUILD_BUSTER),BLDENV=buster $(MAKE) -f Makefile.work $@,)
|
|
|
|
$(if $(BUILD_BULLSEYE),BLDENV=bullseye $(MAKE) -f Makefile.work $@,)
|
2023-06-26 11:14:51 -05:00
|
|
|
$(if $(BUILD_BOOKWORM),BLDENV=bookworm $(MAKE) -f Makefile.work $@,)
|
2021-08-05 20:11:54 -05:00
|
|
|
endef
|
|
|
|
|
|
|
|
.PHONY: $(PLATFORM_PATH)
|
|
|
|
|
|
|
|
$(PLATFORM_PATH):
|
|
|
|
@echo "+++ Cheking $@ +++"
|
|
|
|
$(PLATFORM_CHECKOUT_CMD)
|
|
|
|
|
|
|
|
configure : $(PLATFORM_PATH)
|
|
|
|
$(call make_work, $@)
|
|
|
|
|
2022-04-27 19:39:37 -05:00
|
|
|
clean reset showtag docker-cleanup sonic-slave-build sonic-slave-bash :
|
2021-08-05 20:11:54 -05:00
|
|
|
$(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)
|