aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 250d8dfa3eabccd31d48514c47437ac0817b50d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
RM := rm
CC := gcc
STRIP := strip
CFLAGS = -Wall -g
OCFLAGS = -m32 -mpreferred-stack-boundary=2 -z execstack -fno-stack-protector
TARGETS = $(patsubst %.c,%.o,$(wildcard *.c))

all: shellcode $(TARGETS) post-build

shellcode:
	make -f shellcode/Makefile SUBDIR=shellcode

post-build:
	@read -p "disable protection stuff? (y/N) " answ; \
	if [ "x$$answ" != "xy" ]; then \
		echo "abort .."; \
		return 0; \
	else \
		./disable_prot.sh; \
	fi

disable-prot:
	if [ `cat /proc/sys/kernel/randomize_va_space` -eq 0 ]; then \
		echo "not necessary to run ./disable_prot.sh"; \
	else \
		./disable_prot.sh; \
	fi

%.o : %.c
	$(CC) $(CFLAGS) $(OCFLAGS) -o $(patsubst %.o,%,$@) $<

clean:
	$(RM) -f $(patsubst %.o,%,$(TARGETS))
	make -f shellcode/Makefile SUBDIR=shellcode clean

.PHONY: shellcode all clean