-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (41 loc) · 1 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
.PHONY: all cotto clean
PATH_VENDOR ?= $(PWD)/vendor
ENV_FILE ?= .env
image := rechtlogisch/cotto
all: clean cotto
cotto:
@if [ -z "$(PATH_VENDOR)" ]; then \
echo "Error: PATH_VENDOR is not set"; \
exit 1; \
elif [ ! -d "$(PATH_VENDOR)" ]; then \
echo "Error: Directory $(PATH_VENDOR) does not exist"; \
exit 2; \
fi
@if [ -z "$$(find '$(PATH_VENDOR)' -name '*otto.*' -print -quit)" ]; then \
echo "Error: No file matching *otto.{dll,dylib,so} found in $(PATH_VENDOR)"; \
exit 3; \
fi
g++ -ldl -L"$(PATH_VENDOR)" -Wl,-rpath,"$(PATH_VENDOR)" -lotto -o cotto cotto.cpp
clean:
rm -f cotto otto.log*
docker-build:
docker build \
-t $(image) \
--platform=linux/amd64 \
.
docker-cmd:
docker run \
-it --rm \
--env-file=$(ENV_FILE) \
--platform=linux/amd64 \
-v $(PATH_DOWNLOAD):/app/download/ \
$(image)
docker-cotto:
docker run \
-it --rm \
--env-file=$(ENV_FILE) \
--platform=linux/amd64 \
--name=cotto \
-v $(PATH_DOWNLOAD):/app/download/ \
$(image) \
./cotto $(input)