make.bat help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
thomas

make.bat help

Post 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
AR

Re:make.bat help

Post 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
thomas

Re:make.bat help

Post by thomas »

GCC: installation problem, cannot exec 'cc1' : no such file or directory
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:make.bat help

Post 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).
jonathanmcdougall

Re:make.bat help

Post 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
Post Reply