]> Devi Nivas Git - cs3210-lab0.git/commitdiff
This should fix building on FreeBSD
authornelhage <nelhage>
Wed, 19 Sep 2007 23:49:52 +0000 (23:49 +0000)
committernelhage <nelhage>
Wed, 19 Sep 2007 23:49:52 +0000 (23:49 +0000)
Makefile

index 8caac2cb9e6b8a827e4cc3d95c4f5188d8de7419..15fe43e150c1bce7e0b84c065bc01266fde2a6d7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,8 @@ OBJDUMP = $(TOOLPREFIX)objdump
 CFLAGS = -fno-builtin -O2 -Wall -MD -ggdb -m32
 CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
 ASFLAGS = -m32
-LDFLAGS = -m elf_i386
+# FreeBSD ld wants ``elf_i386_fbsd''
+LDFLAGS += -m $(shell $(LD) -V | grep elf_i386 2>/dev/null)
 
 xv6.img: bootblock kernel fs.img
        dd if=/dev/zero of=xv6.img count=10000