Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. WIT_BASE = wiimms-iso-tools/project
  2. WWT_O = $(WIT_BASE)/cert.o \
  3. $(WIT_BASE)/dclib-basics.o \
  4. $(WIT_BASE)/dclib-cli.o \
  5. $(WIT_BASE)/dclib-color.o \
  6. $(WIT_BASE)/dclib-debug.o \
  7. $(WIT_BASE)/dclib-file.o \
  8. $(WIT_BASE)/dclib-numeric.o \
  9. $(WIT_BASE)/dclib-option.o \
  10. $(WIT_BASE)/dclib-parser.o \
  11. $(WIT_BASE)/dclib-regex.o \
  12. $(WIT_BASE)/dclib-shift-jis.o \
  13. $(WIT_BASE)/dclib-tables.o \
  14. $(WIT_BASE)/dclib-ui.o \
  15. $(WIT_BASE)/dclib-utf8.o \
  16. $(WIT_BASE)/dclib-vector.o \
  17. $(WIT_BASE)/dclib-xdump.o \
  18. $(WIT_BASE)/file-formats.o \
  19. $(WIT_BASE)/gen-ui.o \
  20. $(WIT_BASE)/iso-interface.o \
  21. $(WIT_BASE)/lib-bzip2.o \
  22. $(WIT_BASE)/lib-ciso.o \
  23. $(WIT_BASE)/lib-dol.o \
  24. $(WIT_BASE)/lib-file.o \
  25. $(WIT_BASE)/lib-gcz.o \
  26. $(WIT_BASE)/lib-lzma.o \
  27. $(WIT_BASE)/lib-sf.o \
  28. $(WIT_BASE)/lib-std.o \
  29. $(WIT_BASE)/libwbfs.o \
  30. $(WIT_BASE)/lib-wdf.o \
  31. $(WIT_BASE)/lib-wia.o \
  32. $(WIT_BASE)/match-pattern.o \
  33. $(WIT_BASE)/patch.o \
  34. $(WIT_BASE)/rijndael.o \
  35. $(WIT_BASE)/sha1_one.o \
  36. $(WIT_BASE)/sha1dgst.o \
  37. $(WIT_BASE)/titles.o \
  38. $(WIT_BASE)/tools.o \
  39. $(WIT_BASE)/wbfs-interface.o \
  40. $(WIT_BASE)/wiidisc.o \
  41. $(WIT_BASE)/src/lzma/LzFind.o \
  42. $(WIT_BASE)/src/lzma/Lzma2Dec.o \
  43. $(WIT_BASE)/src/lzma/Lzma2Enc.o \
  44. $(WIT_BASE)/src/lzma/LzmaDec.o \
  45. $(WIT_BASE)/src/lzma/LzmaEnc.o \
  46. $(WIT_BASE)/src/libbz2/blocksort.o \
  47. $(WIT_BASE)/src/libbz2/bzlib.o \
  48. $(WIT_BASE)/src/libbz2/compress.o \
  49. $(WIT_BASE)/src/libbz2/crctable.o \
  50. $(WIT_BASE)/src/libbz2/decompress.o \
  51. $(WIT_BASE)/src/libbz2/huffman.o \
  52. $(WIT_BASE)/src/libbz2/randtable.o
  53. ifeq ($(PREFIX),)
  54. PREFIX := /usr
  55. endif
  56. # Build shared lib from wwt
  57. .PHONY : shared
  58. shared:
  59. @cd $(WIT_BASE) && CFLAGS="-fPIC -DUSE_SHA_LIB" $(MAKE) wwt
  60. @mkdir -p bin/shared/
  61. @gcc -shared $(WWT_O) \
  62. -ltinfo -lz -lm -lncurses -lcrypto \
  63. -o bin/shared/libwwt.so
  64. @./gen_config.sh
  65. # Build static lib from wwt
  66. .PHONY : static
  67. static:
  68. @cd $(WIT_BASE) && $(MAKE) wwt
  69. @mkdir -p bin/static/
  70. @ar rcs bin/static/libwwt.a $(WWT_O)
  71. .PHONY : clean
  72. clean:
  73. @cd $(WIT_BASE) && $(MAKE) clean
  74. @rm -f bin/static/libwwt.a
  75. @rm -f bin/shared/libwwt.so
  76. .PHONY : install
  77. install:
  78. # The lib
  79. install -d $(DESTDIR)$(PREFIX)/lib/
  80. install -m 644 bin/shared/libwwt.so $(DESTDIR)$(PREFIX)/lib/
  81. install -m 644 libwwtConfig.sh $(DESTDIR)$(PREFIX)/lib/
  82. # Includes
  83. install -d $(DESTDIR)$(PREFIX)/include/libwwt/dclib
  84. install -d $(DESTDIR)$(PREFIX)/include/libwwt/libwbfs
  85. install -d $(DESTDIR)$(PREFIX)/include/libwwt/crypto
  86. install -m 644 $(WIT_BASE)/dclib/*.h $(DESTDIR)$(PREFIX)/include/libwwt/dclib
  87. install -m 644 $(WIT_BASE)/version.h $(DESTDIR)$(PREFIX)/include/libwwt
  88. install -m 644 $(WIT_BASE)/src/*.h $(DESTDIR)$(PREFIX)/include/libwwt
  89. install -m 644 $(WIT_BASE)/src/libwbfs/*.h $(DESTDIR)$(PREFIX)/include/libwwt/libwbfs
  90. install -m 644 $(WIT_BASE)/src/crypto/*.h $(DESTDIR)$(PREFIX)/include/libwwt/crypto