-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (23 loc) · 580 Bytes
/
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
CC = gcc
NIM = nim
PY = python3
all: random_list merge_sort
random_list:
$(PY) $@_generator.py
merge_sort:
$(CC) $@.c -o $@_c.bin
$(NIM) c -d:release --verbosity:0 -o:$@_nim.bin $@.nim
clean:
rm -rf random_list.txt
rm -rf *.bin
run: merge_sort
@echo -n "\n\t=== MEMORY LAYOUT ===\n"
@echo -n "> C to binary:\n"
size -B $<_c.bin
@echo -n "> NIM (to C) to binary:\n"
size -B $<_nim.bin
@echo -n "\n\t=== CPU TIME ===\n"
@echo -n "> C to binary:\n"
/usr/bin/time ./$<_c.bin 1>/dev/null
@echo -n "> NIM (to C) to binary:\n"
/usr/bin/time ./$<_nim.bin 1>/dev/null