summaryrefslogtreecommitdiff
path: root/payloads/libpayload/sample/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/sample/Makefile')
-rw-r--r--payloads/libpayload/sample/Makefile14
1 files changed, 4 insertions, 10 deletions
diff --git a/payloads/libpayload/sample/Makefile b/payloads/libpayload/sample/Makefile
index 1daea5f6ec..e01d4e85df 100644
--- a/payloads/libpayload/sample/Makefile
+++ b/payloads/libpayload/sample/Makefile
@@ -29,23 +29,17 @@
# Sample libpayload Makefile.
-CC = gcc
-CROSS_CFLAGS = -m32
+CC := ../bin/lpgcc
-INCLUDES = -I../include
-INCLUDES += -I$(shell $(CC) $(CROSS_CFLAGS) -print-search-dirs | head -n 1 | cut -d' ' -f2)include
-
-LIBPAYLOAD = ../libpayload.a
-LIBGCC := $(shell $(CC) $(CROSS_CFLAGS) -print-libgcc-file-name)
-CFLAGS := -Wall -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
+CFLAGS := -Wall -Werror -Os
all: hello.elf
hello.elf: hello.o
- ld -T ../libpayload.ldscript -o $@ hello.o ../i386/head.o $(LIBPAYLOAD) $(LIBGCC)
+ $(CC) -o $@ hello.o
hello.o: hello.c
- $(CC) $(CROSS_CFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f hello.elf hello.o