CC = /ncsu/simplescalar/tools/bin/sslittle-na-sstrix-gcc
CFLAGS = -S
LOOP_BOUND_EXE = ../src/loopbound

all:
	$(CC) $(CFLAGS) test_all_fors.c -O0 -o test_all_fors_O0.s
	$(CC) $(CFLAGS) test_all_fors.c -O1 -o test_all_fors_O1.s
	$(CC) $(CFLAGS) test_all_fors.c -O2 -o test_all_fors_O2.s
	$(CC) $(CFLAGS) test_mixed.c -O0 -o test_mixed_O0.s
	$(CC) $(CFLAGS) test_mixed.c -O1 -o test_mixed_O1.s
	$(CC) $(CFLAGS) test_mixed.c -O2 -o test_mixed_O2.s

clean:
	rm -f output_* *.loop

fullclean:
	rm -f *_O*.s *.loop output_*


test:   
	$(LOOP_BOUND_EXE) test_all_fors_O0.s > output_test_all_fors_O0
	$(LOOP_BOUND_EXE) test_all_fors_O1.s > output_test_all_fors_O1
	$(LOOP_BOUND_EXE) test_all_fors_O2.s > output_test_all_fors_O2
	$(LOOP_BOUND_EXE) test_mixed_O0.s > output_test_mixed_O0
	$(LOOP_BOUND_EXE) test_mixed_O1.s > output_test_mixed_O1
	$(LOOP_BOUND_EXE) test_mixed_O2.s > output_test_mixed_O2

