-
Notifications
You must be signed in to change notification settings - Fork 2
/
Elitefile
96 lines (74 loc) · 1.94 KB
/
Elitefile
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
set ProjectName as "Elitebuild"
set BIN_PATH as "/usr/bin/"
set COMPILER as "gcc"
set PATH as "{BIN_PATH}{COMPILER}"
set fn as "for"
set commandline as "argument"
set echo as "println"
set Linux as "linux"
set FreeBSD as "freebsd"
set HOME_PATH as env "HOME"
set USERNAME as env "USER"
\\set arguments as string (
\\ "example.cpp",
\\ "main.cpp"
\\)
\\ set flags as string (
\\ f("curl")
\\)
\\ for signal "start"
$fn signal "start" [
println "HOME_PATH: {HOME_PATH} | USERNAME : {USERNAME}"
\\ You can also use $ProjectName instead of formatter
if eq "{ProjectName}" "Elitebuild" [
\\ println "Hello, Elitebuild"
$echo "Hello, {ProjectName}!"
]
if uneq "{COMPILER}" "gcc" [
println "Your compiler seemsly not GCC, unoptimized."
]
println "Default compiler is: {COMPILER}"
set echo as "print"
$echo "Huh!"
set echo as "println"
\\ Prints newline
$echo
\\ for argument "hi"
$fn $commandline "hi" [
\\ $echo "Hi!"
println "Hi!"
]
for argument "all" [
println "There's nothing to do."
]
// Platform-specific functions.
for specific "{Linux}" [
for exists $PATH [
println "Compiler path found: {PATH}"
]
println "Linux-based"
]
for specific "{FreeBSD}" [
println "FreeBSD"
]
\\for argument("make") [
\\ for specific("linux") [
\\ use commandline(
\\ $COMPILER,
\\ $arguments,
\\ $flags
\\ )
\\ print "hello, world"
\\
\\ use commandline(
\\ "echo",
\\ "hello, world"
\\ )
\\ ]
\\]
for specific $Linux [
use exec "echo 'Hello, {ProjectName} from syscall! ({Linux}-based)'"
use signal "exit"
]
for specific $FreeBSD [ use exec "uname --a" ]
]