CC=clang
LD=ld
CFLAGS:=-O0

.PHONY: clean

build: thrasher-1-pages

thrasher-%-pages : *.c *.h *.py 
	./gen_thrash.py $* --file thrash-$*-pages.s
	$(CC) $(CFLAGS) $(PGFLAGS) thrash-$*-pages.s thrasher.c -Wl,--null-phdrs=$(shell expr $* + 5) -o $@

thrasher-%-pages-nojump : *.c *.h *.py
	./gen_thrash.py $* --file thrash-$*-pages-nojump.s --no-jump
	$(CC) $(CFLAGS) $(PGFLAGS) thrash-$*-pages-nojump.s thrasher.c -o $@

clean:
	rm -f thrasher-*-pages thrasher-*-pages-nojump thrash-*-pages*.s thrasher.o
