-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
63 lines (48 loc) · 1.55 KB
/
makefile
File metadata and controls
63 lines (48 loc) · 1.55 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
NODE = node
REQUIRED_NODE_VERSION = 18.17.0
SRCDIR = ./src
TESTDIR = ./testes
SCRIPT = $(SRCDIR)/main.js
DEFAULT_INPUT = input-base.txt
# Preparação do ambiente
all: remove_conflicting_packages install_node_without_nvm
# Remove pacotes conflitantes
remove_conflicting_packages:
@echo "Removendo pacotes conflitantes..."; \
sudo apt-get remove --purge nodejs libnode72 -y || true; \
sudo apt-get autoremove -y || true; \
sudo apt-get clean || true;
# Instalação do Node.js diretamente (sem nvm)
install_node_without_nvm:
@echo "Instalando Node.js versão $(REQUIRED_NODE_VERSION)..."; \
sudo apt-get install -y curl; \
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -; \
sudo apt-get install -y nodejs; \
node -v
# Regra para rodar ambos os algoritmos com o arquivo padrão ou especificado
run:
$(NODE) $(SCRIPT) $(TESTDIR)/$(input) saida.txt
# Regras para rodar testes individuais de força bruta
run-1:
$(NODE) $(SCRIPT) $(TESTDIR)/input-1.txt saida.txt
run-2:
$(NODE) $(SCRIPT) $(TESTDIR)/input-2.txt saida.txt
run-3:
$(NODE) $(SCRIPT) $(TESTDIR)/input-3.txt saida.txt
run-4:
$(NODE) $(SCRIPT) $(TESTDIR)/input-4.txt saida.txt
run-5:
$(NODE) $(SCRIPT) $(TESTDIR)/input-5.txt saida.txt
run-6:
$(NODE) $(SCRIPT) $(TESTDIR)/input-6.txt saida.txt
run-7:
$(NODE) $(SCRIPT) $(TESTDIR)/input-7.txt saida.txt
run-8:
$(NODE) $(SCRIPT) $(TESTDIR)/input-8.txt saida.txt
run-9:
$(NODE) $(SCRIPT) $(TESTDIR)/input-9.txt saida.txt
# Valor padrão para a variável input
input ?= $(DEFAULT_INPUT)
# Limpar arquivos de logs
clean:
rm -f *.log