Joey Armstrong | 36c9bcd | 2023-04-05 19:05:56 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 2c03936 | 2024-02-04 18:51:52 -0500 | [diff] [blame] | 3 | # Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 36c9bcd | 2023-04-05 19:05:56 -0400 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
Joey Armstrong | 2c03936 | 2024-02-04 18:51:52 -0500 | [diff] [blame] | 17 | # SPDX-FileCopyrightText: 2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 36c9bcd | 2023-04-05 19:05:56 -0400 | [diff] [blame] | 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ----------------------------------------------------------------------- |
| 20 | |
| 21 | $(if $(DEBUG),$(warning ENTER)) |
| 22 | |
| 23 | ##--------------------## |
| 24 | ##---] INCLUDES [---## |
| 25 | ##--------------------## |
| 26 | include $(MAKEDIR)/release/consts.mk |
| 27 | include $(MAKEDIR)/release/macros.mk |
| 28 | |
| 29 | ## ----------------------------------------------------------------------- |
| 30 | ## Intent: Dispaly a help section for release targets |
| 31 | ## ----------------------------------------------------------------------- |
| 32 | help:: |
| 33 | @echo |
| 34 | @echo '[RELEASE]' |
| 35 | @echo ' release Creates release ready binaries for BBSimctl and BBR artifacts' |
| 36 | |
| 37 | ##--------------------## |
| 38 | ##---] INCLUDES [---## |
| 39 | ##--------------------## |
| 40 | include $(MAKEDIR)/release/bbr.mk |
| 41 | include $(MAKEDIR)/release/bbsim.mk |
| 42 | include $(MAKEDIR)/release/bbsimctl.mk |
| 43 | |
| 44 | ## ----------------------------------------------------------------------- |
| 45 | ## Intent: Cross-compile binaries for release |
| 46 | ## ----------------------------------------------------------------------- |
| 47 | release-target-deps += release-bbr |
| 48 | release-target-deps += release-bbsim |
| 49 | # release-deps += release-bbsimctl |
| 50 | |
| 51 | ## ----------------------------------------------------------------------- |
| 52 | ## Intent: Create a release from targets release-{bbr,bbsim,bbsimctl} |
| 53 | ## Debug: $(foreach tgt,$(release-target-deps),$(info ** release-target-deps=$(tgt))) |
| 54 | ## ----------------------------------------------------------------------- |
| 55 | .PHONY: release |
| 56 | release: $(release-target-deps) |
| 57 | |
| 58 | ## ----------------------------------------------------------------------- |
| 59 | ## Intent: Initialize storage then build release target groups (bbr, bbsim) |
| 60 | ## ----------------------------------------------------------------------- |
| 61 | .PHONY: $(release-targetdeps) |
| 62 | $(release-target-deps) : release-init-mkdir |
| 63 | |
| 64 | ## ----------------------------------------------------------------------- |
| 65 | ## Intent: Prepare for a clean release build |
| 66 | ## ----------------------------------------------------------------------- |
| 67 | release-init: |
| 68 | @echo |
| 69 | @echo "** -----------------------------------------------------------------------" |
| 70 | @echo "** $(MAKE): processing target [$@]" |
| 71 | @echo "** -----------------------------------------------------------------------" |
| 72 | |
| 73 | @echo -e "\n** Create filesystem target for docker volume: $(RELEASE_DIR)" |
| 74 | $(RM) -r "./$(RELEASE_DIR)" |
| 75 | mkdir -vp "$(RELEASE_DIR)" |
| 76 | |
| 77 | ## ----------------------------------------------------------------------- |
| 78 | ## Intent: Create storage for release binaries and docker volume mount |
| 79 | ## ----------------------------------------------------------------------- |
| 80 | .PHONY: release-init |
| 81 | release-init-mkdir: |
| 82 | mkdir -vp "$(RELEASE_DIR)" |
| 83 | |
| 84 | $(if $(DEBUG),$(warning LEAVE)) |
| 85 | |
| 86 | # [EOF] |