htslib.mk 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Makefile rules useful for third-party code using htslib's public API.
  2. #
  3. # Copyright (C) 2013-2014 Genome Research Ltd.
  4. #
  5. # Author: John Marshall <jm18@sanger.ac.uk>
  6. # The makefile fragment included below provides variables that can be used
  7. # to express dependencies on headers supplied by an in-development htslib.
  8. # If your source file foo.c #includes <htslib/hts.h> and <htslib/kstring.h>,
  9. # you can write the correct prerequisites for foo.o as:
  10. #
  11. # HTSDIR = <path to htslib top-level directory>
  12. # include $(HTSDIR)/htslib.mk
  13. #
  14. # foo.o: foo.c $(htslib_hts_h) $(HTSDIR)/htslib/kstring.h
  15. #
  16. # Variables are not provided for k*.h, as those never include other headers.
  17. HTSPREFIX = $(HTSDIR)/
  18. include $(HTSDIR)/htslib_vars.mk
  19. # Rules for rebuilding an in-development htslib's static and shared libraries.
  20. # If your program foo links with libhts, adding the appropriate prerequisite
  21. # will cause the library to be rebuilt as necessary:
  22. #
  23. # foo: foo.o $(HTSDIR)/libhts.a
  24. #
  25. # or similarly if your target requires any of the tools supplied:
  26. #
  27. # bar.bed.bgz.tbi: bar.bed.bgz $(HTSDIR)/tabix
  28. # $(HTSDIR)/tabix -p bed bar.bed.bgz
  29. HTSLIB_PUBLIC_HEADERS = \
  30. $(HTSDIR)/htslib/bgzf.h \
  31. $(HTSDIR)/htslib/faidx.h \
  32. $(HTSDIR)/htslib/hfile.h \
  33. $(HTSDIR)/htslib/hts.h \
  34. $(HTSDIR)/htslib/hts_defs.h \
  35. $(HTSDIR)/htslib/khash.h \
  36. $(HTSDIR)/htslib/klist.h \
  37. $(HTSDIR)/htslib/knetfile.h \
  38. $(HTSDIR)/htslib/kseq.h \
  39. $(HTSDIR)/htslib/ksort.h \
  40. $(HTSDIR)/htslib/kstdint.h \
  41. $(HTSDIR)/htslib/kstring.h \
  42. $(HTSDIR)/htslib/sam.h \
  43. $(HTSDIR)/htslib/synced_bcf_reader.h \
  44. $(HTSDIR)/htslib/tbx.h \
  45. $(HTSDIR)/htslib/vcf.h \
  46. $(HTSDIR)/htslib/vcf_sweep.h \
  47. $(HTSDIR)/htslib/vcfutils.h
  48. HTSLIB_ALL = \
  49. $(HTSLIB_PUBLIC_HEADERS) \
  50. $(HTSDIR)/bgzf.c \
  51. $(HTSDIR)/faidx.c \
  52. $(HTSDIR)/hfile_internal.h \
  53. $(HTSDIR)/hfile.c \
  54. $(HTSDIR)/hfile_net.c \
  55. $(HTSDIR)/hts.c \
  56. $(HTSDIR)/knetfile.c \
  57. $(HTSDIR)/kstring.c \
  58. $(HTSDIR)/sam.c \
  59. $(HTSDIR)/synced_bcf_reader.c \
  60. $(HTSDIR)/tbx.c \
  61. $(HTSDIR)/vcf.c \
  62. $(HTSDIR)/vcf_sweep.c \
  63. $(HTSDIR)/vcfutils.c \
  64. $(HTSDIR)/cram/cram.h \
  65. $(HTSDIR)/cram/cram_codecs.c \
  66. $(HTSDIR)/cram/cram_codecs.h \
  67. $(HTSDIR)/cram/cram_decode.c \
  68. $(HTSDIR)/cram/cram_decode.h \
  69. $(HTSDIR)/cram/cram_encode.c \
  70. $(HTSDIR)/cram/cram_encode.h \
  71. $(HTSDIR)/cram/cram_index.c \
  72. $(HTSDIR)/cram/cram_index.h \
  73. $(HTSDIR)/cram/cram_io.c \
  74. $(HTSDIR)/cram/cram_io.h \
  75. $(HTSDIR)/cram/cram_samtools.c \
  76. $(HTSDIR)/cram/cram_samtools.h \
  77. $(HTSDIR)/cram/cram_stats.c \
  78. $(HTSDIR)/cram/cram_stats.h \
  79. $(HTSDIR)/cram/cram_structs.h \
  80. $(HTSDIR)/cram/files.c \
  81. $(HTSDIR)/cram/mFILE.c \
  82. $(HTSDIR)/cram/mFILE.h \
  83. $(HTSDIR)/cram/md5.c \
  84. $(HTSDIR)/cram/md5.h \
  85. $(HTSDIR)/cram/misc.h \
  86. $(HTSDIR)/cram/open_trace_file.c \
  87. $(HTSDIR)/cram/open_trace_file.h \
  88. $(HTSDIR)/cram/os.h \
  89. $(HTSDIR)/cram/pooled_alloc.c \
  90. $(HTSDIR)/cram/pooled_alloc.h \
  91. $(HTSDIR)/cram/sam_header.c \
  92. $(HTSDIR)/cram/sam_header.h \
  93. $(HTSDIR)/cram/string_alloc.c \
  94. $(HTSDIR)/cram/string_alloc.h \
  95. $(HTSDIR)/cram/thread_pool.c \
  96. $(HTSDIR)/cram/thread_pool.h \
  97. $(HTSDIR)/cram/vlen.c \
  98. $(HTSDIR)/cram/vlen.h \
  99. $(HTSDIR)/cram/zfio.c \
  100. $(HTSDIR)/cram/zfio.h
  101. $(HTSDIR)/libhts.a: $(HTSLIB_ALL)
  102. +cd $(HTSDIR) && $(MAKE) lib-static
  103. $(HTSDIR)/libhts.so $(HTSDIR)/libhts.dylib: $(HTSLIB_ALL)
  104. +cd $(HTSDIR) && $(MAKE) lib-shared
  105. $(HTSDIR)/bgzip: $(HTSDIR)/bgzip.c $(HTSLIB_PUBLIC_HEADERS)
  106. +cd $(HTSDIR) && $(MAKE) bgzip
  107. $(HTSDIR)/tabix: $(HTSDIR)/tabix.c $(HTSLIB_PUBLIC_HEADERS)
  108. +cd $(HTSDIR) && $(MAKE) tabix
  109. # Rules for phony targets. You may wish to have your corresponding phony
  110. # targets invoke these in addition to their own recipes:
  111. #
  112. # clean: clean-htslib
  113. clean-htslib install-htslib:
  114. +cd $(HTSDIR) && $(MAKE) $(@:-htslib=)
  115. .PHONY: clean-htslib install-htslib