-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (47 loc) · 2.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# ------------------------------------------------------------------------------
# ALIASES
# ------------------------------------------------------------------------------
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(dir $(MKFILE_PATH))
ROOT_DIR := $(MKFILE_DIR)
DOCKER_COMPOSE_FILES := \
-f $(ROOT_DIR)/docker-compose.yaml
# ------------------------------------------------------------------------------
# IMAGES
# ------------------------------------------------------------------------------
IMAGES := template_pkg
PUB_AND_SUB := pub_and_sub_pkg
# ------------------------------------------------------------------------------
# PARAMETERS
# ------------------------------------------------------------------------------
INPUT_TOPIC ?= example_topic
WHEEL_DISTNCE ?= 1.5
MAX_WHEEL_SPEED ?= 3
PARAMETERS := \
ROOT_DIR=$(ROOT_DIR) \
INPUT_TOPIC=$(INPUT_TOPIC) \
WHEEL_DISTNCE=$(WHEEL_DISTNCE) \
MAX_WHEEL_SPEED=$(MAX_WHEEL_SPEED)
# ------------------------------------------------------------------------------
# COMMANDS
# ------------------------------------------------------------------------------
BUILD_COMMAND := docker compose $(DOCKER_COMPOSE_FILES) build
RUN_COMMAND := docker compose $(DOCKER_COMPOSE_FILES) up
# ------------------------------------------------------------------------------
# GENERAL INTERFACE
# ------------------------------------------------------------------------------
build:
@echo "ROOT_DIR: $(ROOT_DIR)"
@echo "Building: $(IMAGES)"
cd $(ROOT_DIR) && $(PARAMETERS) $(BUILD_COMMAND) $(IMAGES)
build_pub_and_sub:
@echo "ROOT_DIR: $(ROOT_DIR)"
@echo "Building: $(IMAGES)"
cd $(ROOT_DIR) && $(PARAMETERS) $(BUILD_COMMAND) $(PUB_AND_SUB)
# ------------------------------------------------------------------------------
run:
@echo "Running: $(IMAGES)"
cd $(ROOT_DIR) && $(PARAMETERS) $(RUN_COMMAND) $(IMAGES)
run_pub_and_sub:
@echo "Running: $(IMAGES)"
cd $(ROOT_DIR) && $(PARAMETERS) $(RUN_COMMAND) $(PUB_AND_SUB)