Page 1 of 1

make.bat help

Posted: Sat Feb 26, 2005 10:31 am
by thomas
i have made a .bat file to build my kernel but it dont work can someone correct it

Code: Select all

 nasm -f aout -o start.o start.asm
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o main.o main.c
ld -T link.ld -o kernel.bin start.o
echo Done!
pause
i need to link main.o into kernel.bin as well

Re:make.bat help

Posted: Sat Feb 26, 2005 11:07 am
by AR
What exactly "doesn't work"?
To add more files to the linker, you simply add them to the command line:

Code: Select all

ld -T Link.ld -o Kernel.bin start.o main.o <More files here>
You need more arguments on gcc:

Code: Select all

gcc -nostdlib -fno-builtin -fno-exceptions -c -Wall -Werror -nostdinc -I./Include -ffreestanding -c -o main.o main.c

Re:make.bat help

Posted: Sat Feb 26, 2005 11:21 am
by thomas
GCC: installation problem, cannot exec 'cc1' : no such file or directory

Re:make.bat help

Posted: Sat Feb 26, 2005 12:38 pm
by Candy
That usually signifies that you either didn't set the right path or screwed up the install completely. The cc1.exe file is the executable of the compiler proper, don't delete it and place it in the path (or more common, move the path so it's on it).

Re:make.bat help

Posted: Sat Feb 26, 2005 12:52 pm
by jonathanmcdougall
Looks like you are trying to execute Cygwin executables from the Windows environment (not within the Cygwin shell). That may be complicated.

If that's the case, you should either use another compiler suite for Windows (djgpp could be one, though I never used it) or keep Cygwin and learn to use make. make.exe will recognize Cygwin paths and will find your executables. Take a look at http://k101.f2g.net/ on Chapter 1.

Jonathan