Skip to content

Commit

Permalink
Makefile: directly call scripts instead of using variables
Browse files Browse the repository at this point in the history
These variables serve no purpose as they are only used once. Drop them,
and call the scripts directly.

This also fixes some of the unnecessary inconsistencies like

  PREPARE_SCRIPT = hack/prepare.sh
  MAKE_E2E_FAST = hack/deploy_fast.sh

  prepare-e2e-test:
      bash $(PREPARE_SCRIPT)
  fast_e2e_test: prepare-e2e-test
      bash $(MAKE_E2E_FAST)

where the variable names, the script names and the Make targets have no
obvious resemblance (with the change, the Make targets are still
inconsistent with the underlying scripts).

Also, the scripts are executable and have a shebang. They choose their
interpreter themselves and the Makefile should not assume that this is
always "bash".
  • Loading branch information
thom311 committed Oct 25, 2024
1 parent 08846c5 commit cf4849e
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,35 +73,28 @@ CONTAINER_TOOL ?= podman
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

# Define the scripts with their paths in the hack folder
PREPARE_SCRIPT = hack/prepare.sh
IPU_HOST_SCRIPT = hack/ipu_host_deploy.sh
IPU_DEPLOY_SCRIPT = hack/ipu_deploy.sh
DEPLOY_TFT_SCRIPT = hack/deploy_traffic_flow_tests.sh
MAKE_E2E_FAST = hack/deploy_fast.sh

.PHONY: default
default: build

.PHONY: prepare-e2e-test
prepare-e2e-test:
bash $(PREPARE_SCRIPT)
./hack/prepare.sh

.PHONY: ipu_host
ipu_host: prepare-e2e-test
bash $(IPU_HOST_SCRIPT)
./hack/ipu_host_deploy.sh

.PHONY: ipu_deploy
ipu_deploy: prepare-e2e-test
bash $(IPU_DEPLOY_SCRIPT)
./hack/ipu_deploy.sh

.PHONY: deploy_tft_tests
deploy_tft_tests:
bash $(DEPLOY_TFT_SCRIPT)
./hack/deploy_traffic_flow_tests.sh

.PHONY: fast_e2e_test
fast_e2e_test: prepare-e2e-test
bash $(MAKE_E2E_FAST)
./hack/deploy_fast.sh

.PHONY: e2e_test
e2e-test: ipu_host ipu_deploy deploy_tft_tests
Expand Down

0 comments on commit cf4849e

Please sign in to comment.