summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-05-17 20:30:46 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-05-17 20:30:46 +0200
commita91dc0e8b48359716fd214f503deb71a0210252d (patch)
tree87ad09ddbd19b83f3ed02d80e0527482d0339553 /src/Makefile
parent4bdc7cb8b68e3ba3aa59b7100e855febe83a5ea8 (diff)
downloadabaos-a91dc0e8b48359716fd214f503deb71a0210252d.tar.gz
abaos-a91dc0e8b48359716fd214f503deb71a0210252d.tar.bz2
some more variables for NASM and OBJCOPY, retested on OSX
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile12
1 files changed, 7 insertions, 5 deletions
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