Page 1 of 1

Makefile and NASM problem

Posted: Fri Mar 14, 2003 5:05 am
by Scalpel
I'm rewriting my Makefile so that it's more automated.

My new Makefile looks like this.
And here is my old Makefile (which works).

My filestructure is like this:

Code: Select all

include/
linking/
objects/
sources/kernel
sources/libc
Makefile
When I run make I get this error:

Code: Select all

Cerberus:~/projects/OS/HelmsDeep# make
g++ -Wall -ffreestanding -fasm -O2 -I./includes -o sources/libc/set_cursor.o sources/libc/set_cursor.c
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
/tmp/cc1YPkRP.o: In function `set_cursor(int, int)':
/tmp/cc1YPkRP.o(.text+0x12): undefined reference to `global_cursor'
collect2: ld returned 1 exit status
make: *** [sources/libc/set_cursor.o] Error 1

What am I doing wrong? I know that the problem is related to the Makefile, cause it works with my oldMakefile.

Re:Makefile and NASM problem

Posted: Fri Mar 14, 2003 6:41 am
by Pype.Clicker
maybe you should add "-c" to your CCFLAGS, to tell the compiler not to try the link stage, but just "-c"ompile :)

Re:Makefile and NASM problem

Posted: Fri Mar 14, 2003 6:52 am
by Scalpel
To say as David Letterman does: "You da man!" Thanks, Pype.Clicker ;)