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
|