summaryrefslogtreecommitdiff
path: root/assignments/3/Makefile
blob: 1a83223b37134775771e72f246de802968a7ffa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
default: main.s main.exe numbers.txt

main.s: main.c
	gcc -S -fverbose-asm -O2 main.c

main.exe: main.c
	gcc -o main.exe main.c

numbers.txt:
	ruby -e '100.times { IO.write("numbers.txt", "#{rand(100_000)}\n", mode: "a+") }'

run: main.exe numbers.txt
	./main.exe < numbers.txt

manual: max_min.s
	as --64 -o max_min.o max_min.s
	ld -o max_min.exe max_min.o
	./max_min.exe

manual_ai: max_min.asm
	as --64 -o max_min.o max_min.asm
	ld -o max_min.exe max_min.o
	./max_min.exe