LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2013, 02:42 AM   #1
saeedsssss
Member
 
Registered: Apr 2012
Posts: 43

Rep: Reputation: Disabled
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.
 
Old 02-07-2013, 03:11 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Try this:

Code:
cd somepath/grub-0.97/stage1
make stage1.o
 
Old 02-07-2013, 03:37 AM   #3
saeedsssss
Member
 
Registered: Apr 2012
Posts: 43

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 02-07-2013, 03:42 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Now what do you really want? Just compile grub from source? Or you have hacked the source and now it doesn't compile?
 
Old 02-09-2013, 09:07 AM   #5
saeedsssss
Member
 
Registered: Apr 2012
Posts: 43

Original Poster
Rep: Reputation: Disabled
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 .
 
Old 02-11-2013, 02:44 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

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

Last edited by NevemTeve; 02-11-2013 at 02:54 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] assembly code ridoy Programming 3 03-29-2011 02:12 PM
need help with preprocessor,code organization(question pertaining to c) amolgupta Programming 4 01-03-2009 07:44 PM
How to converting the c++ code to assembly Nejad Programming 17 12-29-2008 12:50 PM
Using C Preprocessor on Fortran Code mkrems Programming 4 07-08-2008 10:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration