addseabios.mk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #
  2. # Copyright (C) 2014 Francis Rowe <info@gluglug.org.uk>
  3. # Copyright (C) 2014 Luke Shumaker <lukeshu@sbcglobal.net>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. #
  18. roms/%_with_seabios.rom: roms/%.rom \
  19. src/$(host_arch)/seabios/out/vgabios.bin \
  20. src/$(host_arch)/seabios/out/bios.bin.elf \
  21. resources/grub/config/seabios.cfg \
  22. $(CBFSTOOL)
  23. cp $< $@.tmp
  24. $(CBFSTOOL) $@.tmp add -f src/$(host_arch)/seabios/out/vgabios.bin -n vgaroms/vgabios.bin -t raw
  25. $(CBFSTOOL) $@.tmp add -f src/$(host_arch)/seabios/out/bios.bin.elf -n bios.bin.elf -t raw
  26. $(CBFSTOOL) $@.tmp extract -n grub.cfg -f $@.tmp.grub.cfg
  27. $(CBFSTOOL) $@.tmp extract -n grubtest.cfg -f $@.tmp.grubtest.cfg
  28. $(CBFSTOOL) $@.tmp remove -n grub.cfg
  29. $(CBFSTOOL) $@.tmp remove -n grubtest.cfg
  30. cat resources/grub/config/seabios.cfg >> $@.tmp.grub.cfg
  31. cat resources/grub/config/seabios.cfg >> $@.tmp.grubtest.cfg
  32. $(CBFSTOOL) $@.tmp add -f $@.tmp.grub.cfg -n grub.cfg -t raw
  33. $(CBFSTOOL) $@.tmp add -f $@.tmp.grubtest.cfg -n grubtest.cfg -t raw
  34. rm -f $@.tmp.grub.cfg $@.tmp.grubtest.cfg
  35. mv $@.tmp $@