diff options
Diffstat (limited to 'shellcode/Makefile')
-rw-r--r-- | shellcode/Makefile | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/shellcode/Makefile b/shellcode/Makefile index e7833cd..2325641 100644 --- a/shellcode/Makefile +++ b/shellcode/Makefile @@ -1,26 +1,14 @@ RM := rm ASM := nasm -CC := gcc -LD := ld -OBJCOPY := objcopy -XXD := xxd -CFLAGS = -c -Wall -fpic -Os -LDFLAGS = SUBDIR ?= . -TARGETS = $(patsubst %.c,%.o,$(wildcard $(SUBDIR)/*.c)) $(patsubst %.asm,%.o,$(wildcard $(SUBDIR)/*.asm)) +TARGETS = $(patsubst %.asm,%.o,$(wildcard $(SUBDIR)/*.asm)) all: $(TARGETS) -%.o : %.c - $(CC) $(CFLAGS) -o $@ $< - $(LD) $(LDFLAGS) -N -Ttext 0x0 -e _start -Map $(patsubst %.o,%.map,$@) $@ -o $(patsubst %.o,%,$@) - $(OBJCOPY) -R .note -R .comment -S -O binary $(patsubst %.o,%,$@) $(patsubst %.o,%.bin,$@) - $(XXD) -i $(patsubst %.o,%.bin,$@) - %.o : %.asm $(ASM) -o $@ $< clean: - $(RM) -f $(patsubst %.o,%.map,$(TARGETS)) $(patsubst %.o,%.bin,$(TARGETS)) $(patsubst %.o,%,$(TARGETS)) $(TARGETS) + $(RM) -f $(TARGETS) .PHONY: all clean |