-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (51 loc) · 1.88 KB
/
Makefile
File metadata and controls
71 lines (51 loc) · 1.88 KB
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
64
65
66
67
68
69
70
71
##
## EPITECH PROJECT, 2020
## makefile
## File description:
## Makefile
##
TARGET_NAME := pbrain-gomoku-ai
TARGET_NAME_WIN := $(TARGET_NAME).exe
TARGET := $(wildcard ./src/*.py) \
$(wildcard ./src/Policies/**/*.py)
PISKVORK := piskvork/piskvork.exe
MAIN := src/main.py
all: build
build: $(TARGET_NAME)
build-windows: $(TARGET_NAME_WIN)
$(TARGET_NAME): $(TARGET)
@ln -s $(MAIN) $(TARGET_NAME)
chmod +x $(TARGET_NAME)
@echo -e "\033[1;32m[OK]\033[0m" $(TARGET_NAME) "copied"
$(TARGET_NAME_WIN): $(TARGET)
@which pyinstaller > /dev/null || (echo -e "\033[1;31m[ERROR]\033[0m pyinstaller is not installed" && exit 1)
@echo "Compiling $(TARGET_NAME_WIN)..."
@pyinstaller --onefile --name $(TARGET_NAME_WIN) --clean --log-level=ERROR $(TARGET) --paths .
@cp dist/$(TARGET_NAME_WIN) $(TARGET_NAME_WIN)
@chmod +x $(TARGET_NAME_WIN)
@echo -e "\033[1;32m[OK]\033[0m" $(TARGET_NAME_WIN) "compiled"
$(PISKVORK):
curl https://altushost-swe.dl.sourceforge.net/project/piskvork/piskvork.zip -o piskvork.zip
unzip piskvork.zip -d piskvork
rm piskvork.zip
run: build-windows $(PISKVORK)
@which wine > /dev/null || (echo -e "\033[1;31m[ERROR]\033[0m wine is not installed" && exit 1)
@echo "Running $(TARGET_NAME_WIN)..."
wine $(PISKVORK) -p "./piskvork/pbrain-pela.exe" "./$(TARGET_NAME_WIN)"
run-win: build-windows $(PISKVORK)
@echo "Running $(TARGET_NAME_WIN)..."
./$(PISKVORK) -p "./piskvork/pbrain-pela.exe" "./$(TARGET_NAME_WIN)"
test: build-windows $(PISKVORK)
@echo "Running tests..."
./$(PISKVORK) -p "./$(TARGET_NAME_WIN)" "./$(TARGET_NAME_WIN)"
install: $(PISKVORK)
@pip3 install -r requirements.txt
clean:
@rm -rf build dist __pycache__ $(TARGET_NAME_WIN).spec
fclean:
@rm -f $(TARGET_NAME_WIN) $(TARGET_NAME)
re: fclean all
uninstall: $(PISKVORK)
@pip3 uninstall -r requirements.txt
rm -rf piskvork
.PHONY: all run run-win fclean clean re install uninstall build build-windows