Code: Select all
ld --oformat=elf32-i386 main.o start.o -o init.o
ld: i386 architecture of input file `main.o' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `start.o' is incompatible with i386:x86-64 output
I'm not sure the whole thing is relevant, but my makefile is simple so I'll post to save you from asking later if you think it will help.
main makefile:
Code: Select all
AS=fasm
ASFLAGS=
CC=gcc
CFLAGS=-c -ffreestanding
CPP=gcc
CPPFLAGS=
LDFLAGS=-nostdlib --oformat=elf32-i386
all : Image
Image : init/init.o
ld --script link.ld init/init.o
init/init.o :
(cd init; make)
clean :
(cd init; make clean)
Code: Select all
AS=fasm
ASFLAGS=
CC=gcc
CFLAGS=-ffreestanding -Wl,--oformat=elf32-i386
CPP=gcc
CPPFLAGS=
LDFLAGS=--oformat=elf32-i386
all : init.o
init.o : main.o start.o
ld $(LDFLAGS) main.o start.o -o init.o
main.o : main.c
$(CC) $(CFLAGS) main.c
start.o : start.asm
$(AS) $(ASFLAGS) start.asm start.o
clean :
rm init.o main.o start.o