.PHONY : all

desac_aslr:
	sudo echo 0 > /proc/sys/kernel/randomize_va_space

################# Q1 #################
q1_32: q1.c
	gcc -m32 -fno-stack-protector -mpreferred-stack-boundary=2 -g -o q1_32 q1.c

q1_64: q1.c
	gcc -m64 -fno-stack-protector -mpreferred-stack-boundary=4 -g -o q1_64 q1.c

################# Q2 #################
q2: q2.c
	gcc -m32 -fno-stack-protector -mpreferred-stack-boundary=2 -g -o q2 q2.c
	./q2

############### Q3 #################
q3_32: q3.c
	gcc -m32 -fno-stack-protector -mpreferred-stack-boundary=2 -g -o q3_32 q3.c

q3_64: q3.c
	gcc -fno-stack-protector -mpreferred-stack-boundary=4 -g -o q3_64 q3.c

################# Q4 #################
q4_32: q4.c
	gcc -m32 -fno-stack-protector -mpreferred-stack-boundary=2 -g -o q4_32 q4.c
q4_64: q4.c
	gcc -fno-stack-protector -mpreferred-stack-boundary=4 -g -o q4_64 q4.c
