master > master: code - makefiles

This commit is contained in:
RD 2021-11-06 10:55:44 +01:00
parent 9e04763782
commit eaef3322d8
2 changed files with 44 additions and 0 deletions

21
code/golang/Makefile Normal file
View File

@ -0,0 +1,21 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# LOCAL ARGUMENTS
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PATH_TO_ARTEFACT:=../../dist/ads
PATH_TO_CONFIG:=../config.yml
COLOUR:=false
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# TARGETS
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setup:
go mod download
build:
go build -o ${PATH_TO_ARTEFACT} main.go
run: # non-interactive mode mit config-datei
${PATH_TO_ARTEFACT} run --debug --colour COLOUR --config "${PATH_TO_CONFIG}"
run-it: # interactive mode
${PATH_TO_ARTEFACT} run --it --debug --colour COLOUR
# Do everything:
all: setup build run
all-it: setup build run-it

23
code/python/Makefile Normal file
View File

@ -0,0 +1,23 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# LOCAL ARGUMENTS
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PATH_TO_CONFIG:=../config.yml
COLOUR:=false
ifeq ($(OS),Windows_NT)
PYTHON:="py -3"
else
PYTHON:="python3"
endif
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# TARGETS
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setup:
${PYTHON} -m pip install -r requirements;
run: # non-interactive mode mit config-datei
${PYTHON} src/main.py run --debug --colour COLOUR --config "${PATH_TO_CONFIG}"
run-it: # interactive mode
${PYTHON} src/main.py run --it --debug --colour COLOUR
# Do everything:
all: setup run
all-it: setup run-it