Makefile.in 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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/imaging/magick.d \
  39. source/mlib/configparser.d \
  40. source/mlib/directories.d \
  41. source/mlib/search_params.d \
  42. source/mlib/trash.d
  43. PDOWN_VERSION_FILE=source/res/VERSION
  44. all: make-tag pixiv_down
  45. # This allows us to only build pixiv_down if the githash has
  46. # changed or one of the files in PDOWN_SOURCES is modified.
  47. make-tag:
  48. @if [ -d .git -a -x "$$(which git)" ]; then \
  49. if [ -r $(PDOWN_VERSION_FILE) ]; then \
  50. prevhash=$$(pr -t $(PDOWN_VERSION_FILE)) ; \
  51. currhash=$$(git describe --tags) ; \
  52. if [ $$prevhash != $$currhash ]; then \
  53. git describe --tags > $(PDOWN_VERSION_FILE) ; \
  54. fi ; \
  55. fi ; \
  56. fi
  57. $(PDOWN_VERSION_FILE):
  58. @test -d source/res || mkdir source/res
  59. @if [ -d .git -a -x "$$(which git)" ]; then \
  60. git describe --tags > $(PDOWN_VERSION_FILE) ; \
  61. else \
  62. pr -t VERSION > $(PDOWN_VERSION_FILE) ; \
  63. fi
  64. clean:
  65. rm -rf pixiv_down \
  66. objs/
  67. distclean: clean
  68. rm -rf Makefile
  69. install: pixiv_down
  70. $(INSTALL_PROGRAM) pixiv_down $(bindir)
  71. $(INSTALL_DATA) docs/pixiv_down.1 \
  72. docs/pixiv_down-artist.1 \
  73. docs/pixiv_down-artwork.1 \
  74. docs/pixiv_down-bookmarked.1 \
  75. docs/pixiv_down-compact.1 \
  76. docs/pixiv_down-daily.1 \
  77. docs/pixiv_down-following.1 \
  78. docs/pixiv_down-novel.1 \
  79. docs/pixiv_down-prune.1 \
  80. $(mandir)/man1
  81. $(INSTALL_DATA) docs/pixiv_down.conf.5 \
  82. $(mandir)/man5
  83. install-strip:
  84. $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
  85. uninstall:
  86. rm ${bindir}/pixiv_down
  87. pixiv_down: $(PDOWN_VERSION_FILE) $(PDOWN_SOURCES)
  88. $(DC) $(DFLAGS) ${oflag}pixiv_down $(PDOWN_SOURCES) $(LDFLAGS) $(LIBS)