LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   assembling a assembly code contain C preprocessor(#define) (https://www.linuxquestions.org/questions/programming-9/assembling-a-assembly-code-contain-c-preprocessor-define-4175448980/)

saeedsssss 02-07-2013 02:42 AM

assembling a assembly code contain C preprocessor(#define)
 
Hi
I try convert assemble code to object file.
but i don't know how we can use gcc for this work, please help me.

now,
I find this file from grub 0.97. name of this file on source code this programm is start1.S. --you can find source code from grub-0.97\stage1\stage1.S--

I want just compiler two file start1.h and start1.S with together and make object file them.

thank you.

NevemTeve 02-07-2013 03:11 AM

Try this:

Code:

cd somepath/grub-0.97/stage1
make stage1.o


saeedsssss 02-07-2013 03:37 AM

After do these commands , i see this error

saeed@saeed-VirtualBox:~/Desktop/grub-0.97-/stage1$ make stage1.o
cc -c -o stage1.o stage1.S
stage1.S:21:20: fatal error: stage1.h: No such file or directory
compilation terminated.
make: *** [stage1.o] Error 1

now what can i do ?

NevemTeve 02-07-2013 03:42 AM

Now what do you really want? Just compile grub from source? Or you have hacked the source and now it doesn't compile?

saeedsssss 02-09-2013 09:07 AM

I want just compiler two file start1.h and start1.S with together and make object file them.
and I don't change source code .

NevemTeve 02-11-2013 02:44 AM

If you didn't change the source ./configure and make would work. (grub-0.97 is very old though)


All times are GMT -5. The time now is 08:40 AM.