mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2024-10-27 20:34:19 +00:00
Use ld through global variable.
This commit is contained in:
parent
dcd3686d37
commit
02a77989c2
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \
|
||||
-Wall -Wextra -Werror
|
||||
@ -17,11 +18,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \
|
||||
-Wall -Wextra -Werror
|
||||
@ -17,11 +18,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
||||
# Change this if your cross-compiler is somewhere else
|
||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||
# -g: Use debugging symbols in gcc
|
||||
CFLAGS = -g -ffreestanding -Wall -Wextra -fno-exceptions -m32
|
||||
|
||||
@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin
|
||||
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||
# to 'strip' them manually on this case
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
${LD} -o $@ -Ttext 0x1000 $^ --oformat binary
|
||||
|
||||
# Used for debugging purposes
|
||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
||||
${LD} -o $@ -Ttext 0x1000 $^
|
||||
|
||||
run: os-image.bin
|
||||
qemu-system-i386 -fda os-image.bin
|
||||
|
Loading…
Reference in New Issue
Block a user