]> git.donarmstrong.com Git - bamtools.git/blobdiff - Makefile
modified/clarified some help & usage messages
[bamtools.git] / Makefile
index 435f776621270dc5a50f6021fe8299f01e057ff4..1dc3f7b1b1ed51862f08967e947e2bfc38eededf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,48 @@
-CXX=           g++\r
-CXXFLAGS=      -Wall -O3\r
-PROG=          bamtools\r
-LIBS=          -lz\r
-OBJS=          BGZF.o BamReader.o BamWriter.o BamMultiReader.o bamtools.o
-\r
-all: $(PROG)\r
-\r
-bamtools: $(OBJS)\r
-       $(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(LIBS)\r
-\r
-clean:\r
-       rm -fr gmon.out *.o *.a a.out *~\r
+# ==========================
+# BamTools Makefile
+# (c) 2010 Derek Barnett
+#
+# top-level
+# ==========================
+
+# define main directories
+export OBJ_DIR  = obj
+export BIN_DIR  = bin
+export SRC_DIR  = src
+
+# define compile/link flags
+export CXX      = g++\r
+export CXXFLAGS = -Wall -O3 -D_FILE_OFFSET_BITS=64
+export LIBS     = -lz
+
+# define current BamTools version
+export BAMTOOLS_VERSION = 0.7.0812
+
+# define source subdirectories
+SUBDIRS = $(SRC_DIR)/api \
+          $(SRC_DIR)/utils \
+          $(SRC_DIR)/third_party \
+          $(SRC_DIR)/toolkit 
+
+all:
+       @echo "Building BamTools:"
+       @echo "Version: $$BAMTOOLS_VERSION"
+       @echo "========================================================="
+       @echo ""
+       @echo "- Creating target directories"
+       @mkdir -p $(BIN_DIR)
+       @mkdir -p $(OBJ_DIR)
+       @echo ""
+       @for dir in $(SUBDIRS); do \
+               echo "- Building in $$dir"; \
+               $(MAKE) --no-print-directory -C $$dir; \
+               echo ""; \
+       done
+
+.PHONY: all
+
+clean:
+       @echo "Cleaning up."
+       @rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
+
+.PHONY: clean