-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
171 lines (130 loc) · 4.02 KB
/
Makefile
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
:PHONY: bash clojure fs go javascript kotlin python ruby scala haskell rust \
elixir rescript typescript sqlite clean rye-docker red-docker groovy-docker cs c++ cpp-fast cpp-slow \
r c asm_80x86
run: bash clojure fs go javascript kotlin python ruby scala haskell rust \
elixir rescript typescript sqlite rye-docker red-docker groovy-docker cs cpp-fast php \
r c
clean: c++-clean c-clean asm_80x86-clean
rm -rf build *.tasty *.class *.class* \
src/ts/*.js src/sqlite/compress_rec.db \
src/cs/*/bin src/cs/*/obj
# Clojure
clojure:
cd src/clojure/clojpression-puzzle && \
clj -X clojpression-puzzle/run
# Crystal
crystal:
cd src/crystal && \
crystal run compress_kbc_0.cr
# F#
fs:
./src/fsharp/compress-pk1.fsx
./src/fsharp/compress-pk2.fsx
./src/fsharp/compress-pk3.fsx
cs:
cd src/cs/pp && dotnet run
cd src/cs/cjenp && dotnet run
cd src/cs/ns && dotnet run
cd src/cs/ns2 && dotnet run
cd src/cs/ns3 && dotnet run
#Bash
bash:
bash src/bash/*.sh
#Go
go:
go run src/go/compress_mitja.go
go run src/go/compress_tit.go
go run src/go/compress_david.go
# Python
python:
find src/python -type f \( -iname "*.py" ! -iname benchmarks.py \) | xargs -n1 python
# JavaScript
javascript:
find src/javascript -type f \( -iname "*.js" \) | xargs -n1 node
# R
r:
find src/r -type f \( -iname "*.R" \) | xargs -n1 Rscript
# Ruby
ruby:
ruby src/ruby/compress-kbc-0.rb
ruby src/ruby/compress-kbc-1.rb
# Scala
CompressionPuzzle01.class:
scalac src/scala/CompressionPuzzle01.scala
CompressionPuzzle02.class:
scalac src/scala/CompressionPuzzle02.scala
CompressionPuzzle03.class:
scalac src/scala/CompressionPuzzle03.scala
scala: CompressionPuzzle01.class CompressionPuzzle02.class CompressionPuzzle03.class
scala CompressionPuzzle01
scala CompressionPuzzle02
scala CompressionPuzzle03
# Kotlin
kotlin:
kotlinc -script src/kotlin/compress.kts
kotlinc -script src/kotlin/mn1024_compress.kts
# Haskell
haskell:
echo "AAABBAAC" | runhaskell src/haskell/Compress_turbomack.hs
# Rust
rust:
rustc src/rust/compress.rs -O --test --out-dir build/rust && ./build/rust/compress
rescript:
(cd src/rescript && rescript) && \
node src/rescript/lib/**/*.js
elixir:
elixir src/elixir/compress.exs
elixir src/elixir/compress_rec.exs
typescript:
yarn run build && \
find src/ts -type f \( -iname "*.js" \) | xargs -n1 node
sqlite:
sqlite3 src/sqlite/compress_rec.db ".read src/sqlite/compress_rec.sql"
cpp-slow:
clang++ -std=c++17 -O3 src/c++/compress_slow.cpp -o src/c++/compress_slow && \
./src/c++/compress_slow
cpp-fast:
clang++ -std=c++17 -O3 src/c++/compress_fast.cpp -o src/c++/compress_fast && \
./src/c++/compress_fast
c++: cpp-slow cpp-fast
c++-clean:
rm -f src/c++/compress_slow src/c++/compress_fast
c:
gcc src/c/tomaz.c -o src/c/tomaz && \
./src/c/tomaz
c-clean:
rm -rf ./src/c/tomaz
java:
javac -d src/java src/java/Compression.java && \
java -cp src/java compression.Compression
# Lua
lua:
lua src/lua/compress.lua
lua src/lua/compress-gsub.lua
## Docker based runners
# Rye
rye-docker:
docker run --rm -v $(PWD):/app --entrypoint /bin/bash refaktorlabs/ryelang:latest /app/src/rye/run-all.sh
# Red
red-docker:
docker run --rm -v $(PWD):/app --entrypoint /bin/bash rebolek/red:latest /app/src/red/run-all.sh
groovy-docker:
docker run --rm -v $(PWD):/home/groovy/scripts \
-w /home/groovy/scripts groovy groovy src/groovy/*.groovy
pascal-docker:
docker run --rm -i -t -v $(PWD)/src/pascal:/source nacyot/pascal-fp_compiler:apt \
pc -Tlinux /source/compress
swift:
swift src/swift/compress_extension_grandfelix.swift
php:
php -f src/php/compress_grandfelix.php
asm_80x86: # Needs FASM to compile https://flatassembler.net/
fasm -d Linux=TRUE src/asm_80x86/compress_simple.asm src/asm_80x86/compress_simple.o
gcc -m32 src/asm_80x86/compress_simple.o -o src/asm_80x86/compress_simple
strip src/asm_80x86/compress_simple
asm_80x86-clean:
rm src/asm_80x86/*.o src/asm_80x86/compress_simple
# Rebuild the README with stats and attributions
update-readme:
./updated-authors.rb > README2.md
mv README2.md README.md