tari

Untitled

Feb 2nd, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1.  
  2. == makefile ==
  3. PROJECT = "foo"
  4.  
  5. LINKER_OPTS = "-s"
  6. OBJECTS = "main.o"
  7.  
  8. all: $(PROJECT).g3a
  9. @echo 'Build complete.'
  10.  
  11. foo.g3a: foo.bin
  12. mkg3a.py -i $(PROJECT).bin -o $(PROJECT).g3a
  13.  
  14. $(PROJECT).bin: $(OBJECTS)
  15. sh-elf-ld -o $(PROJECT).bin -lgcc -T prizm.lkr $(LINKER_OPTS) $(OBJECTS)
  16.  
  17. %.o: %.c
  18. sh-elf-gcc -Wa -g -mbig-endian-data -c -x c -o "$@" "$<"
  19.  
  20. %.o: %.asm
  21. sh-elf-gcc -Wa -g -mbig-endian-data -c -x assembler-with-cpp -o "$@" "$<"
  22.  
  23. clean:
  24. rm $(OBJECTS) $(PROJECT).bin $(PROJECT).g3a
  25.  
  26. == prizm.lkr ==
  27. OUTPUT_FORMAT(binary)
  28.  
  29. # MEMORY
  30. # {
  31. # ram rwx : ORIGIN = 0x00300000, LENGTH = ??
  32. # }
  33.  
  34. # Add-in has a 0x7000 byte header and gets loaded into RAM at
  35. # 0x00300000 when run.
  36. SECTIONS
  37. {
  38. . = 0x00307000;
  39. .text : { *(.text) }
  40. .data : { *(.text) }
  41. .bss : { *(.bss) }
  42. }
Add Comment
Please, Sign In to add comment