LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-27-2008, 05:25 AM   #1
sancho1980
Member
 
Registered: May 2006
Location: Leipzig, Germany
Distribution: Kanotix 64
Posts: 45

Rep: Reputation: 15
makefile problem


hi

i have the following lines (among others) in my makefile:

GDT_SIZE = $$(stat -c %s gdt.bin)
...
512.bin: 512.asm Makefile kernel.bin gdt.bin
-rm 512.bin
OFFSET=$(OFFSET) BOOT_SIZE=$(BOOT_SIZE) GDT_SIZE=$$(( (($(GDT_SIZE) / 512) + 1) * 512 )) VIDEO_SIZE=$(VIDEO_SIZE) NO_SEGMENTS=$(NO_SEGMENTS) nasm -f bin 512.asm -o 512.bin

Where it says GDT_SIZE=$$(( (($(GDT_SIZE) / 512) + 1) * 512 )), what I *really* want to write here is:

if GDT_SIZE % 512 != 0:

GDT_SIZE=$$(( (($(GDT_SIZE) / 512) + 1) * 512 ))

else

GDT_SIZE=$$(( (($(GDT_SIZE) / 512)) * 512 ))

But I dont get it done. I dont know how to say that (syntactically) in my makefile. Any ideas?

Thanks

Martin
 
Old 07-28-2008, 12:21 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
GDT_SIZE := $$(stat -c %s gdt.bin)
GDT_SIZE := $$(echo "(($(GDT_SIZE) / 512) + 1) * 512" | bc)
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Makefile problem HarryBoy Linux - Newbie 3 05-09-2008 03:41 AM
Makefile Problem utkarshrawat Programming 2 04-02-2008 10:10 PM
problem with Makefile shifter Programming 1 07-27-2007 04:31 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:14 AM.

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