From a91dc0e8b48359716fd214f503deb71a0210252d Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 17 May 2017 20:30:46 +0200 Subject: some more variables for NASM and OBJCOPY, retested on OSX --- src/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 45498bb..f22b5c0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,6 +2,8 @@ CC := gcc CFLAGS := -std=c99 -m32 -ffreestanding -O0 -g -Wall -Werror LD := ld LDFLAGS := -f elf32 +NASM := nasm +OBJCOPY := objcopy all: image.bin kernel.sym @@ -17,13 +19,13 @@ image.bin: boot.bin kernel.bin magic.bin cat image.tmp magic.bin > image.bin boot.bin: boot.asm gdt.asm stage1_functions.asm stage2_functions.asm switch_mode.asm - nasm boot.asm -f bin -o boot.bin + $(NASM) boot.asm -f bin -o boot.bin kernel.bin: kernel.elf - objcopy -O binary kernel.elf kernel.bin + $(OBJCOPY) -O binary kernel.elf kernel.bin kernel.sym: kernel.elf - objcopy --only-keep-debug kernel.elf kernel.sym + $(OBJCOPY) --only-keep-debug kernel.elf kernel.sym kernel.elf: kernel.o console.o vga.o serial.o port.o port_asm.o string.o stdlib.o $(LD) -o kernel.elf -N -n -Ttext 0x8400 --oformat elf32-i386 \ @@ -31,7 +33,7 @@ kernel.elf: kernel.o console.o vga.o serial.o port.o port_asm.o string.o stdlib. string.o stdlib.o magic.bin: magic.asm - nasm magic.asm -f bin -o magic.bin + $(NASM) magic.asm -f bin -o magic.bin kernel.o: kernel.c $(CC) $(CFLAGS) -c -o kernel.o kernel.c @@ -49,7 +51,7 @@ serial.o: serial.c serial.h $(CC) $(CFLAGS) -c -o serial.o serial.c port_asm.o: port.asm - nasm port.asm $(LDFLAGS) -o port_asm.o + $(NASM) port.asm $(LDFLAGS) -o port_asm.o string.o: string.c string.h $(CC) $(CFLAGS) -c -o string.o string.c -- cgit v1.2.3-54-g00ecf