summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-09-24 11:41:27 -0700
committerPatrick Tjin <pattjin@google.com>2014-07-21 20:22:38 -0700
commitde0e4d223d083d695d62c4d057f40105a2889e76 (patch)
tree87869c1d34b59d016af573e3ab327d96fe9598fd
parent56ce5adc402b046a8531047f48d2aef778baebd1 (diff)
downloadbootstub-de0e4d223d083d695d62c4d057f40105a2889e76.tar.gz
Add CFLAGS to allow for cross compiling from x86_64
Could be smarter to avoid having to uncomment it, but works fine for me.
-rw-r--r--Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0c89f9c..8e1f045 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,7 @@
OBJ=bootstub.o spi-uart.o head.o
+CFLAGS=-ffreestanding -Wall
+#for cross compile
+#CFLAGS=-m32 -ffreestanding -Wall
all: bootstub
@@ -12,13 +15,13 @@ bootstub.elf:bootstub.lds $(OBJ)
ld -m elf_i386 -T bootstub.lds $(OBJ) -o $@
bootstub.o:bootstub.c bootstub.h
- gcc -Wall -c bootstub.c
+ gcc $(CFLAGS) -c bootstub.c
spi-uart.o:spi-uart.c spi-uart.h
- gcc -Wall -c spi-uart.c
+ gcc $(CFLAGS) -c spi-uart.c
head.o:head.S bootstub.h
- gcc -Wall -c head.S
+ gcc $(CFLAGS) -c head.S
clean:
rm -rf *.o *.bin *.elf *.bz2 *.rpm