CC = gcc
CFLAGS = -Wall -g -fno-stack-protector -O0 -m32
LDFLAGS = -z execstack

PROGRAMS = pilha pilha2 \
           buffer buffer-strcpy buffer-strcpy-canary \
	   execve \
           map-armadilha-loop map-vitima \
           map-armadilha-printf map-armadilha-exit \
           map-armadilha-execve map-armadilha-execve2 \
           buffer-shellcode \
           buffer-libc buffer-libc-canary

all: $(PROGRAMS)

buffer-strcpy-canary: buffer-strcpy.c
	$(CC) -g -m32 -fstack-protector-all buffer-strcpy.c -o buffer-strcpy-canary

buffer-libc-canary: buffer-libc.c
	$(CC) -g -m32 -fstack-protector-all buffer-libc.c -o buffer-libc-canary

clean:
	rm -f *~ $(PROGRAMS)