summaryrefslogtreecommitdiff
path: root/payloads/libpayload/sample/Makefile
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2008-04-09 23:05:59 +0000
committerJordan Crouse <jordan.crouse@amd.com>2008-04-09 23:05:59 +0000
commitc3e728fbdfa6a92a9b07e46d0ae0da7259e29d35 (patch)
tree9b14e10e81915b670af9acfb28dbbb898f26c9aa /payloads/libpayload/sample/Makefile
parentc5a78ac56ad9078fe70c2753c46ca4d500840ee8 (diff)
downloadcoreboot-c3e728fbdfa6a92a9b07e46d0ae0da7259e29d35.tar.xz
libpayload: Implement gcc wrappers for libpayload
libpayload uses a ton of flags and other scary gcc and ld options. These wrappers hide most of that from the user, so that using libpayload is as easy as lpgcc -o hello hello.c Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3226 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
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