Makefile and NASM problem

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
Scalpel

Makefile and NASM problem

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Makefile and NASM problem

Post 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 :)
Scalpel

Re:Makefile and NASM problem

Post by Scalpel »

To say as David Letterman does: "You da man!" Thanks, Pype.Clicker ;)
Post Reply