make me understand make
Posted: Sun Aug 05, 2007 10:31 am
hi
im really desperate here, i dont understand make, really
have a look at this:
Let me explain what this is *supposed* to do:
When boot.bin is made, the following things should occur (in this order):
1) Execute "ld main.o video.o utilities.o -e start -N -M > boot.mem -o boot.bin --oformat binary -T script"
2) Set BOOT_SIZE to contain the size of the newly created file "boot.bin" in bytes
3) Append zeroes to the end of "boot.bin" until the size (in bytes) of "boot.bin" is a multiple of 512.
When 512.bin is made, the following should occur (in this order):
1) "make boot.bin"
2) Make 512.bin via execution of "nasm -f bin 512.asm -o 512.bin" passing BOOT_SIZE to the compiler as an environment variable. This time, however, I want to refer to BOOT_SIZE as the NEW size of boot.bin (i.e. the multiple of 512).
When will I get this done? Any ideas?
Thanks
Martin
im really desperate here, i dont understand make, really
have a look at this:
Code: Select all
#begin Makefile
BOOT_SIZE = $(shell stat -c %s boot.bin)
512.bin: 512.asm Makefile boot.bin.bin
-rm 512.bin
export BOOT_SIZE=$(BOOT_SIZE); nasm -f bin 512.asm -o 512.bin
boot.bin: main.o video.o utilities.o Makefile
ld main.o video.o utilities.o -e start -N -M > boot.mem -o boot.bin --oformat binary -T script
ndisasm -b 32 boot.bin > boot.ndisasm
dd if=/dev/null of=gdt.bin seek=$(shell expr $(shell expr $(BOOT_SIZE) / 512) + 1) count=1
#end Makefile
When boot.bin is made, the following things should occur (in this order):
1) Execute "ld main.o video.o utilities.o -e start -N -M > boot.mem -o boot.bin --oformat binary -T script"
2) Set BOOT_SIZE to contain the size of the newly created file "boot.bin" in bytes
3) Append zeroes to the end of "boot.bin" until the size (in bytes) of "boot.bin" is a multiple of 512.
When 512.bin is made, the following should occur (in this order):
1) "make boot.bin"
2) Make 512.bin via execution of "nasm -f bin 512.asm -o 512.bin" passing BOOT_SIZE to the compiler as an environment variable. This time, however, I want to refer to BOOT_SIZE as the NEW size of boot.bin (i.e. the multiple of 512).
When will I get this done? Any ideas?
Thanks
Martin