Makefile.in 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. .POSIX:
  2. DC=@DC@
  3. DFLAGS=@DFLAGS@
  4. LDFLAGS=@LDFLAGS@
  5. LIBS=@LIBS@
  6. prefix=@prefix@
  7. bindir=@bindir@
  8. datadir=@datadir@
  9. mandir=@mandir@
  10. oflag=@oflag@
  11. INSTALL=install
  12. INSTALL_PROGRAM=$(INSTALL)
  13. INSTALL_DATA=$(INSTALL) -m644
  14. PDOWN_SOURCES=source/app.d \
  15. source/configuration.d \
  16. source/logger.d \
  17. source/pd_version.d \
  18. source/pixiv.d \
  19. source/pixiv_downloader.d \
  20. source/term.d \
  21. source/util.d \
  22. source/cmds/artist.d \
  23. source/cmds/artwork.d \
  24. source/cmds/bookmarked.d \
  25. source/cmds/compact.d \
  26. source/cmds/daily.d \
  27. source/cmds/following.d \
  28. source/cmds/novel.d \
  29. source/cmds/package.d \
  30. source/cmds/prune.d \
  31. source/gif_writer/common.d \
  32. source/gif_writer/osx.d \
  33. source/gif_writer/package.d \
  34. source/gif_writer/posix.d \
  35. source/image_reader/osx.d \
  36. source/image_reader/package.d \
  37. source/image_reader/posix.d \
  38. source/mlib/configparser.d \
  39. source/mlib/directories.d \
  40. source/mlib/search_params.d \
  41. source/mlib/trash.d
  42. PDOWN_VERSION_FILE=source/res/VERSION
  43. all: make-tag pixiv_down
  44. # This allows us to only build pixiv_down if the githash has
  45. # changed or one of the files in PDOWN_SOURCES is modified.
  46. make-tag:
  47. @if [ -d .git -a -x "$$(which git)" ]; then \
  48. if [ -r $(PDOWN_VERSION_FILE) ]; then \
  49. prevhash=$$(pr -t $(PDOWN_VERSION_FILE)) ; \
  50. currhash=$$(git describe --tags) ; \
  51. if [ $$prevhash != $$currhash ]; then \
  52. git describe --tags > $(PDOWN_VERSION_FILE) ; \
  53. fi ; \
  54. fi ; \
  55. fi
  56. $(PDOWN_VERSION_FILE):
  57. @test -d source/res || mkdir source/res
  58. @if [ -d .git -a -x "$$(which git)" ]; then \
  59. git describe --tags > $(PDOWN_VERSION_FILE) ; \
  60. else \
  61. pr -t VERSION > $(PDOWN_VERSION_FILE) ; \
  62. fi
  63. clean:
  64. rm -rf pixiv_down \
  65. objs/
  66. distclean: clean
  67. rm -rf Makefile
  68. install: pixiv_down
  69. $(INSTALL_PROGRAM) pixiv_down $(bindir)
  70. $(INSTALL_DATA) docs/pixiv_down.1 \
  71. docs/pixiv_down-artist.1 \
  72. docs/pixiv_down-artwork.1 \
  73. docs/pixiv_down-bookmarked.1 \
  74. docs/pixiv_down-compact.1 \
  75. docs/pixiv_down-daily.1 \
  76. docs/pixiv_down-following.1 \
  77. docs/pixiv_down-novel.1 \
  78. docs/pixiv_down-prune.1 \
  79. $(mandir)/man1
  80. $(INSTALL_DATA) docs/pixiv_down.conf.5 \
  81. $(mandir)/man5
  82. install-strip:
  83. $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
  84. uninstall:
  85. rm ${bindir}/pixiv_down
  86. pixiv_down: $(PDOWN_VERSION_FILE) $(PDOWN_SOURCES)
  87. $(DC) $(DFLAGS) ${oflag}pixiv_down $(PDOWN_SOURCES) $(LDFLAGS) $(LIBS)