DEFINES= -DDEBUG
CFLAGS = -Os -ggdb -Wall -fno-builtin -nostdlib -fomit-frame-pointer -fno-unit-at-a-time -Wl,-evirus_start

all: test

cavity: cavity.c set_mark
	gcc $(CFLAGS) $(DEFINES) cavity.c -o cavity
	./set_mark cavity

set_mark: ../Prepender/set_mark.c
	$(CC) $< -o $@

test: cavity
	cp /bin/ls .
	-./cavity
	gcc victim.c -o victim
	./ls
	./victim

clean:
	-@rm -f cavity ls set_mark victim

.PHONY: all clean
