aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoni <toni@devlap.local>2015-03-04 18:59:52 +0100
committertoni <toni@devlap.local>2015-03-04 18:59:52 +0100
commit15fbdd7e155e5181de6a82c34e419488bc9626d0 (patch)
tree75067d25e35a0b784293d8f26fab2aeb76a6a11e
parent4ba94d8232cdb61b8e07c4a80197d9f704620ffb (diff)
- Makefile: new target 'debug'
-rw-r--r--Makefile7
-rw-r--r--crypter/Makefile7
2 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index dbb5a92..145ddf4 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,8 @@ RM := rm
CC := gcc
STRIP := strip
LBITS := $(shell getconf LONG_BIT)
-CFLAGS = -Wall -g
-OCFLAGS = -z execstack -fno-stack-protector
+CFLAGS += -Wall
+OCFLAGS += -z execstack -fno-stack-protector
X86_FLAGS = -m32 -mpreferred-stack-boundary=2
X64_FLAGS = -m64 -mpreferred-stack-boundary=4
SOURCES = $(wildcard *.c)
@@ -15,6 +15,9 @@ all: $(TARGETS) shellcode crypter
main: $(TARGETS)
+debug:
+ $(MAKE) -C . CFLAGS="-g"
+
shellcode:
$(MAKE) -C shellcode all
diff --git a/crypter/Makefile b/crypter/Makefile
index f64183f..db2b296 100644
--- a/crypter/Makefile
+++ b/crypter/Makefile
@@ -4,7 +4,7 @@ CC := gcc
LD := ld
XXD := xxd
ASMFLAGS = -g
-CFLAGS ?= -Wall -fpic -Os
+CFLAGS += -fpic -Os
X86_FLAGS := -m32
X64_FLAGS := -m64
LDFLAGS ?=
@@ -27,8 +27,8 @@ ifneq ($(SCC),yes)
$(error Please run 'make' first in the main directory)
endif
@echo "generating header $(patsubst %.c,%.h,$<) for target $<"
- -$(shell $(SCDIR)/sc-test -p $(SUBDIR)/`cat "$<" | sed -n 's/.*#DECODER=//p'` | sed 's/shellcode/decoder/' > $(patsubst %.o,%.h,$@))
- -$(shell $(SCDIR)/sc-test -p $(SUBDIR)/`cat "$<" | sed -n 's/.*#SHELLCODE=//p'` >> $(patsubst %.o,%.h,$@))
+ -$(shell $(SCDIR)/sc-test -p $(SUBDIR)/`cat "$<" | sed -n 's/.*#DECODER=//p'` | sed 's/shellcode/decoder/' > $(patsubst %.c,%.h,$<))
+ -$(shell $(SCDIR)/sc-test -p $(SUBDIR)/`cat "$<" | sed -n 's/.*#SHELLCODE=//p'` >> $(patsubst %.c,%.h,$<))
$(CC) $(CFLAGS) $(X86_FLAGS) -D_USE_CFG -o $(patsubst %.c,%,$<) $<
ifeq ($(LBITS),64)
$(CC) $(CFLAGS) $(X64_FLAGS) -D_USE_CFG -o $(patsubst %.c,%_x64,$<) $<
@@ -36,6 +36,7 @@ endif
clean:
$(RM) -f $(patsubst %.c,%,$(SOURCES_C)) $(patsubst %.c,%_x64,$(SOURCES_C))
+ $(RM) -f $(patsubst %.c,%.h,$(SOURCES_C))
$(RM) -f $(patsubst %.asm,%.o,$(SOURCES_ASM))
.PHONY: all clean