-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmake.ps1
103 lines (97 loc) · 3.07 KB
/
make.ps1
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
## MakeFile alternative
function compilation{
echo "........compilling.........."
# remove the -D ROll if the roll func creates problem
g++ -c .\src\*.cpp -I.\include -D ROLL
# resource file handling
windres icon.rc -o icon.o
echo "..........moving............"
#Move-Item -Path *.o -Destination .\obj -force
echo ".........linking............"
# remove the -D ROll if the roll func creates problem
g++ -o "Fox's Tale" .\*.o -L.\lib -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system -mwindows -D ROLL
mv .\"Fox's Tale".exe .\bin -force
echo "...........done............."
}
function withoutRoll{
echo "........compilling.........."
g++ -c .\src\*.cpp -I.\include
# resource file handling
windres icon.rc -o icon.o
echo "..........moving............"
#Move-Item -Path *.o -Destination .\obj -force
echo ".........linking............"
g++ -o "Fox's Tale" .\*.o -L.\lib -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system -mwindows
mv .\"Fox's Tale".exe .\bin -force
echo "...........done............."
}
function cleaning{
echo "........cleaning.........."
#rm .\obj\*.o
rm .\*.o
echo "...........done............."
}
function cleaningall{
echo "........cleaning.........."
rm .\*.o
rm .\bin\"Fox's Tale".exe
#rm hscore.savefile
rm .\bin\data\hscore.savefile
echo "...........done............."
}
function Helpmenu{
echo "Write -c for compilation, clean for deleting the .o files and cleanall for .o and .exe file"
echo "And -e to execute the game"
echo "Or you can pass -a/all to all three (compile,clean,execute)"
}
function RunAgain{
$param2= Read-Host "Enter the command,sire!!"
switch ($param2){
"-h" {Helpmenu; Break}
"help" {Helpmenu; Break}
"compile" {compilation}
"-c" {compilation}
"-cr" {withoutRoll}
"clean" {cleaning}
"cleanall" {cleaningall; Break}
"execute" {.\bin\"Fox's Tale".exe; Break}
"-e" {.\bin\"Fox's Tale".exe; Break}
"all" {
compilation;
cleaning;
#.\bin\"Fox's Tale".exe;
Break
}
"-a" {
compilation;
cleaning;
#.\bin\"Fox's Tale".exe;
Break
}
}
}
$params =$args[0]
switch ($params){
"" {Helpmenu; RunAgain; Break}
"-h" {Helpmenu; Break}
"help" {Helpmenu; Break}
"compile" {compilation}
"-c" {compilation}
"-cr" {withoutRoll}
"clean" {cleaning}
"cleanall" {cleaningall; Break}
"execute" {.\bin\"Fox's Tale".exe; Break}
"-e" {.\bin\"Fox's Tale".exe; Break}
"all" {
compilation;
cleaning;
#.\bin\"Fox's Tale".exe;
Break
}
"-a" {
compilation;
cleaning;
#.\bin\"Fox's Tale".exe;
Break
}
}