-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile
More file actions
executable file
·62 lines (58 loc) · 1.25 KB
/
compile
File metadata and controls
executable file
·62 lines (58 loc) · 1.25 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
#!/bin/bash
FILE=$1
extension=${FILE##*.}
#filename=$(basename -- "$FILE")
filename="${FILE%.*}"
if [ $extension = "cpp" ]
then
cp $1 ~/Programming/to_compile.cpp
#g++ -std=c++17 ~/Programming/to_compile.cpp -o ~/Programming/compiled
g++ -std=c++17 $1 -o ~/Programming/compiled
#g++ -std=c++17 -O2 -Wall -Wextra -Wshadow -Wconversion -std=c++17 -ggdb $1 -o ~/Programming/compiled
#g++ -std=c++17 -O2 -Wall -Wextra -Werror -Wshadow -Wconversion -std=c++17 -ggdb $1 -o ~/Programming/compiled
# g++ -std=c++17 -fsanitize=undefined -Wall -Wextra -Werror $1 -o ~/Programming/compiled
shift
if [ -n "$1" ]
then
time ~/Programming/./compiled < $1
else
#valgrind -q --error-exitcode=123 ~/Programming/./compiled
time ~/Programming/./compiled
fi
rm -rf ~/Programming/compiled
elif [ $extension = "py" ]
then
shift
if [ -n "$1" ]
then
time python3.8 $FILE < $1
else
time python3.8 $FILE
fi
elif [ $extension = "go" ]
then
shift
if [ -n "$1" ]
then
time go run $FILE < $1
else
time go run $FILE
fi
elif [ $extension = "tex" ]
then
#time
echo $filename
pdflatex $FILE
tmp=$filename
tmp+=".idx"
rm $tmp
tmp=$filename
tmp+=".aux"
rm $tmp
tmp=$filename
tmp+=".log"
rm $tmp
result=$filename
result+=".pdf"
zathura $result
fi