a-conjecture-of-mine

An exercise on polyglossy: the same problem solved on multiple languages

Makefile (1180B)

 1 .PHONY: all c cpp elixir go haskell java kotlin ocaml rust wasm mercury
 2 
 3 all: c cpp elixir go haskell java ocaml rust wasm
 4 
 5 c:
 6 	gcc -O2 -o bin/c ./c/main.c
 7 
 8 cpp:
 9 	g++ -O2 -o ./bin/cpp -std=c++11 ./c++/main.cpp
10 
11 elixir:
12 	elixirc -o bin/elixir ./elixir/main.ex
13 
14 go:
15 	cd ./go/ && go build && mv ./go ../bin/go
16 
17 haskell:
18 	ghc --make -O -o ./bin/haskell ./haskell/Main.hs \
19 	  && rm ./haskell/*.o ./haskell/*.hi
20 
21 java:
22 	javac ./java/Main.java
23 	jar cfe ./bin/java.jar Main ./java/Main.class && rm ./java/*.class
24 
25 kotlin:
26 	kotlinc ./kotlin/main.kt -d ./bin/kotlin.jar
27 
28 ocaml:
29 	ocamlfind                  \
30 		ocamlopt                 \
31 		-thread                  \
32 		-package threads         \
33 		-nodynlink               \
34 		-o ./bin/ocaml           \
35 		-linkpkg ./ocaml/main.ml \
36 	  && rm ./ocaml/*.cmi ./ocaml/*.cmx ./ocaml/*.o
37 
38 rust:
39 	rustc -v -O -o ./bin/rust ./rust/main.rs
40 
41 wasm:
42 	wat2wasm ./wasm/main.wat -o ./bin/wasm.wasm
43 
44 mercury:
45 	cd mercury && mmc main.m -o bin/mercury
46 	rm mercury/*.o mercury/*.c
47 
48 proof.pdf: proof.tex
49 	xelatex -halt-on-error proof.tex 
50 	ls ./*.* \
51 		| sed -E '/\.(aux|bak|bbl|blg|log|nav|out|xml|snm|toc)$$/!d' \
52 		| sed "s/\(.*\)/'\1'/" \
53 		| xargs -r rm
54