All pastes #437388 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-13 00:23 UTC
rendered paste body
OBJCOPY=objcopy

CFLAGS=-Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -O3 -fno-builtin -fno-stack-protector -fPIC

rom_objs=romHeader.o foo.o

all: vmi.img

%.o: %.S
	$(CC) $(CFLAGS) -o $@ -c $<

vmi.a: $(rom_objs)
	$(AR) rcs $@ $(rom_objs)

%.elf: %.ld %.a
	$(LD) $*.a -o $@ -T $*.ld

%.img: %.elf
	$(OBJCOPY) -O binary -j .text -j .data -j .text.1 $< $@

%.bin: %.img
	./fixRom -o $@ $<

clean:
	$(RM) *.o vmi.a vmi.bin vmi.img