Makefile 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #
  2. # Makefile for ich9deblob utility from libreboot project
  3. #
  4. # Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. CC=gcc
  20. FORCEC99=-std=c99
  21. CFLAGS=-I. -Wall -Wextra -g $(FORCEC99)
  22. NOLINKER=-c
  23. .PHONY: all clean
  24. all: ich9deblob ich9gen demefactory
  25. ich9deblob: obj/ich9deblob.o obj/common/descriptor_gbe.o \
  26. obj/descriptor/descriptor.o obj/gbe/gbe.o obj/common/x86compatibility.o
  27. $(CC) $(CFLAGS) obj/ich9deblob.o obj/common/descriptor_gbe.o \
  28. obj/common/x86compatibility.o obj/descriptor/descriptor.o obj/gbe/gbe.o \
  29. -o ich9deblob
  30. ich9gen: obj/ich9gen.o obj/ich9gen/mkdescriptor.o obj/ich9gen/mkgbe.o \
  31. obj/common/descriptor_gbe.o \
  32. obj/descriptor/descriptor.o obj/gbe/gbe.o obj/common/x86compatibility.o
  33. $(CC) $(CFLAGS) obj/ich9gen.o obj/ich9gen/mkdescriptor.o obj/ich9gen/mkgbe.o \
  34. obj/common/descriptor_gbe.o \
  35. obj/common/x86compatibility.o obj/descriptor/descriptor.o obj/gbe/gbe.o \
  36. -o ich9gen
  37. demefactory: obj/demefactory.o obj/common/descriptor_gbe.o \
  38. obj/descriptor/descriptor.o obj/gbe/gbe.o obj/common/x86compatibility.o
  39. $(CC) $(CFLAGS) obj/demefactory.o obj/common/descriptor_gbe.o \
  40. obj/common/x86compatibility.o obj/descriptor/descriptor.o obj/gbe/gbe.o \
  41. -o demefactory
  42. # for demefactory
  43. # ----------------------------------------------------------------------
  44. obj/demefactory.o:
  45. $(CC) $(CFLAGS) $(NOLINKER) src/demefactory.c -o obj/demefactory.o
  46. # for ich9deblob
  47. # ----------------------------------------------------------------------
  48. obj/ich9deblob.o:
  49. $(CC) $(CFLAGS) $(NOLINKER) src/ich9deblob.c -o obj/ich9deblob.o
  50. # for ich9gen
  51. # ----------------------------------------------------------------------
  52. obj/ich9gen.o:
  53. $(CC) $(CFLAGS) $(NOLINKER) src/ich9gen.c -o obj/ich9gen.o
  54. obj/ich9gen/mkdescriptor.o:
  55. $(CC) $(CFLAGS) $(NOLINKER) src/ich9gen/mkdescriptor.c -o obj/ich9gen/mkdescriptor.o
  56. obj/ich9gen/mkgbe.o:
  57. $(CC) $(CFLAGS) $(NOLINKER) src/ich9gen/mkgbe.c -o obj/ich9gen/mkgbe.o
  58. # for demefactory, ich9deblob and ich9gen:
  59. # ----------------------------------------------------------------------
  60. obj/common/descriptor_gbe.o:
  61. $(CC) $(CFLAGS) $(NOLINKER) src/common/descriptor_gbe.c -o obj/common/descriptor_gbe.o
  62. obj/common/x86compatibility.o:
  63. $(CC) $(CFLAGS) $(NOLINKER) src/common/x86compatibility.c -o obj/common/x86compatibility.o
  64. obj/descriptor/descriptor.o:
  65. $(CC) $(CFLAGS) $(NOLINKER) src/descriptor/descriptor.c -o obj/descriptor/descriptor.o
  66. obj/gbe/gbe.o:
  67. $(CC) $(CFLAGS) $(NOLINKER) src/gbe/gbe.c -o obj/gbe/gbe.o
  68. # make clean
  69. # ----------------------------------------------------------------------
  70. clean:
  71. rm -Rf ich9deblob ich9gen demefactory obj/*.o obj/*/*.o