Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Makefile #25

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cpp/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
all: main

clean:
rm -f main || true
rm -f main

main: src/main.cpp
clang++ -std=c++17 -O3 -Wall -Wextra -pedantic-errors -march=native -mtune=native -I external_projects/robin-hood-hashing/src/include -o main src/main.cpp
clang++ -std=c++17 -O3 -Wall -Wextra -pedantic-errors -march=native -mtune=native -I external_projects/robin-hood-hashing/src/include -o $@ $<

.PHONY: all clean
4 changes: 3 additions & 1 deletion cython/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
all: main

clean:
cd src && rm -f cy_g.c cy_g.*.so || true
cd src && rm -f cy_g.c cy_g.*.so

main: src/cy_g.pyx
pip install -r requirements.txt
cd src && python3 setup.py build_ext --inplace

.PHONY: main clean
10 changes: 6 additions & 4 deletions dart/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
SRC = lib

all: main
all: bin/main

clean:
rm bin/main
rm -f bin/main

main: $(SRC)/main.dart
bin/main: $(SRC)/main.dart
mkdir -p bin
dart compile exe -o bin/main ${SRC}/main.dart
dart compile exe -o $@ $<

run: bin/main
bin/main

.PHONY: all clean run
6 changes: 4 additions & 2 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
all: main

clean:
rm -f main || true
rm -f main

main: src/main.go src/priorityqueue.go
go build src/main.go src/priorityqueue.go
go build $^

.PHONY: all clean
4 changes: 3 additions & 1 deletion javascript/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
all:
npm install

.PHONY: all
clean:

.PHONY: all clean
13 changes: 10 additions & 3 deletions julia/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
all: src/main.jl src/priorityqueue.jl

compile: src/main.jl src/priorityqueue.jl
compile: main

clean:
rm -rf out main

main: src/main.jl src/priorityqueue.jl
mkdir -p out
# julia --output-jl out/main.jl src/main.jl
julia --output-o out/main.o --sysimage /home/reki/.asdf/installs/julia/1.4.1/julia/lib/julia/sys.so --startup-file=no src/main.jl
cc -o main out/sys.o -ljulia
julia --output-o out/main.o --sysimage ${ASDF_DIR}/installs/julia/1.4.1/julia/lib/julia/sys.so --startup-file=no $<
cc -o $@ out/sys.o -ljulia

.PHONY: all compile clean
7 changes: 5 additions & 2 deletions kotlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ SRC = src/main/kotlin/main
all: main.jar

clean:
rm -f main.jar || true
rm -f main.jar

main.jar: $(SRC)/main.kt $(SRC)/priorityqueue.kt
kotlinc $(SRC)/main.kt $(SRC)/priorityqueue.kt -include-runtime -d main.jar
kotlinc $^ -include-runtime -d $@

run: main.jar
java -jar $<

.PHONY: all clean run
4 changes: 4 additions & 0 deletions pypy/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
all: src/main.py

clean:

.PHONY: all clean
4 changes: 4 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
all: src/main.py

clean:

.PHONY: all clean
6 changes: 4 additions & 2 deletions rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ all: main

clean:
cargo clean
rm -f main || true
rm -f main

main: src/main.rs
cargo build --release
cp -p ./target/release/langs-bench-rust ./main
cp -p ./target/release/langs-bench-rust ./$@

.PHONY: all clean