help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

someone make me understand make please


From: Martin Knappe
Subject: someone make me understand make please
Date: Sun, 05 Aug 2007 20:00:11 +0100
User-agent: Thunderbird 1.5.0.12 (X11/20070604)

hi

im trying to write a makefile; it doesnt work out the way i want; ill just put part of it here so you're not put off:

#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


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 kilobytes 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).


Someone please help me with this. I've tried all I can think of...I'm starting to think this isn't even possible with make...

:-(

Thanks

Martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]