From e367c742181ddaad5debe059eef4fec747301c59 Mon Sep 17 00:00:00 2001
From: Aaron <aaronquinlan@gmail.com>
Date: Mon, 26 Apr 2010 16:47:23 -0400
Subject: [PATCH] Updated Makefiles to use -O2 instead of -O3.

---
 src/bamFillMateSeq/Makefile          | 45 ++++++++++++++++++++++++
 src/bamToBed/Makefile                |  2 +-
 src/bedToBam/Makefile                |  2 +-
 src/closestBed/Makefile              |  2 +-
 src/complementBed/Makefile           |  2 +-
 src/coverageBed/Makefile             |  2 +-
 src/fastaFromBed/Makefile            |  2 +-
 src/genomeCoverageBed/Makefile       |  2 +-
 src/intersectBed/Makefile            |  2 +-
 src/linksBed/Makefile                |  2 +-
 src/maskFastaFromBed/Makefile        |  2 +-
 src/mergeBed/Makefile                |  2 +-
 src/overlap/Makefile                 |  2 +-
 src/pairToBed/Makefile               |  2 +-
 src/pairToPair/Makefile              |  2 +-
 src/shuffleBed/Makefile              |  2 +-
 src/slopBed/Makefile                 |  2 +-
 src/sortBed/Makefile                 |  2 +-
 src/subtractBed/Makefile             |  2 +-
 src/utils/BamTools/Makefile          |  2 +-
 src/utils/bedFile/Makefile           |  2 +-
 src/utils/bedFilePE/Makefile         |  2 +-
 src/utils/genomeFile/Makefile        |  2 +-
 src/utils/gzstream/Makefile          | 51 ++++++++++++++++++++++++++++
 src/utils/lineFileUtilities/Makefile |  2 +-
 src/utils/sequenceUtilities/Makefile |  2 +-
 src/windowBed/Makefile               |  2 +-
 27 files changed, 121 insertions(+), 25 deletions(-)
 create mode 100755 src/bamFillMateSeq/Makefile
 create mode 100644 src/utils/gzstream/Makefile

diff --git a/src/bamFillMateSeq/Makefile b/src/bamFillMateSeq/Makefile
new file mode 100755
index 00000000..da902162
--- /dev/null
+++ b/src/bamFillMateSeq/Makefile
@@ -0,0 +1,45 @@
+CXX=		g++
+CXXFLAGS=	-Wall  -g
+LIBS=		-lz
+UTILITIES_DIR = ../utils/
+OBJ_DIR = ../../obj/
+BIN_DIR = ../../bin/
+
+# -------------------
+# define our includes
+# -------------------
+INCLUDES = -I$(UTILITIES_DIR)/BamTools/ -I$(UTILITIES_DIR)/sequenceUtilities/ -I$(UTILITIES_DIR)/version/
+
+# ----------------------------------
+# define our source and object files
+# ----------------------------------
+SOURCES= bamFillMateSeq.cpp
+OBJECTS= $(SOURCES:.cpp=.o)
+_EXT_OBJECTS=BamReader.o BamWriter.o sequenceUtils.o BGZF.o
+EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
+BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
+PROGRAM= bamFillMateSeq
+
+
+all: $(PROGRAM)
+
+.PHONY: all
+
+
+$(PROGRAM): $(BUILT_OBJECTS) $(EXT_OBJECTS)
+	@echo "  * linking $(PROGRAM)"
+	@$(CXX) $(LDFLAGS) $(CXXFLAGS) -o $(BIN_DIR)/$@ $^ $(LIBS)
+
+$(BUILT_OBJECTS): $(SOURCES)
+	@echo "  * compiling" $(*F).cpp
+	@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
+
+$(EXT_OBJECTS):
+	@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/sequenceUtilities/
+	@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/BamTools/	
+	
+clean:
+	@echo "Cleaning up."
+	@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
+
+.PHONY: clean
diff --git a/src/bamToBed/Makefile b/src/bamToBed/Makefile
index 263bebc5..d9baa942 100755
--- a/src/bamToBed/Makefile
+++ b/src/bamToBed/Makefile
@@ -1,5 +1,5 @@
 CXX=		g++
-CXXFLAGS=	-Wall -O3
+CXXFLAGS=	-Wall -O2
 LIBS=		-lz
 UTILITIES_DIR = ../utils/
 OBJ_DIR = ../../obj/
diff --git a/src/bedToBam/Makefile b/src/bedToBam/Makefile
index 06f35b12..f5493cda 100755
--- a/src/bedToBam/Makefile
+++ b/src/bedToBam/Makefile
@@ -1,5 +1,5 @@
 CXX=		g++
-CXXFLAGS=	-Wall -O3
+CXXFLAGS=	-Wall -O2
 LIBS=		-lz
 UTILITIES_DIR = ../utils/
 OBJ_DIR = ../../obj/
diff --git a/src/closestBed/Makefile b/src/closestBed/Makefile
index 2d8365bc..bc1cff42 100755
--- a/src/closestBed/Makefile
+++ b/src/closestBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3 -Wall
+CXXFLAGS = -O2 -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
diff --git a/src/complementBed/Makefile b/src/complementBed/Makefile
index 9a391333..53046ece 100755
--- a/src/complementBed/Makefile
+++ b/src/complementBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS= -lz
 
diff --git a/src/coverageBed/Makefile b/src/coverageBed/Makefile
index 34c7a023..b0541907 100755
--- a/src/coverageBed/Makefile
+++ b/src/coverageBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS=	-lz
 
diff --git a/src/fastaFromBed/Makefile b/src/fastaFromBed/Makefile
index dfb77b31..a8fe494f 100755
--- a/src/fastaFromBed/Makefile
+++ b/src/fastaFromBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
diff --git a/src/genomeCoverageBed/Makefile b/src/genomeCoverageBed/Makefile
index 6914f42a..eab20b12 100755
--- a/src/genomeCoverageBed/Makefile
+++ b/src/genomeCoverageBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS=	-lz
 
diff --git a/src/intersectBed/Makefile b/src/intersectBed/Makefile
index 91f1cac4..789c6333 100644
--- a/src/intersectBed/Makefile
+++ b/src/intersectBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS=	-lz
 
diff --git a/src/linksBed/Makefile b/src/linksBed/Makefile
index 52adfd4f..e31a5d17 100755
--- a/src/linksBed/Makefile
+++ b/src/linksBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS =
 LIBS = -lz
 
diff --git a/src/maskFastaFromBed/Makefile b/src/maskFastaFromBed/Makefile
index 4f04142b..0b7bae53 100755
--- a/src/maskFastaFromBed/Makefile
+++ b/src/maskFastaFromBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
diff --git a/src/mergeBed/Makefile b/src/mergeBed/Makefile
index c7baa923..8ac8079e 100755
--- a/src/mergeBed/Makefile
+++ b/src/mergeBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
diff --git a/src/overlap/Makefile b/src/overlap/Makefile
index d6c6b178..3e1faaff 100755
--- a/src/overlap/Makefile
+++ b/src/overlap/Makefile
@@ -1,5 +1,5 @@
 CXX=		g++
-CXXFLAGS=	-Wall -O3
+CXXFLAGS=	-Wall -O2
 LDFLAGS = 
 LIBS= -lz
 
diff --git a/src/pairToBed/Makefile b/src/pairToBed/Makefile
index bbb8a601..1964ae97 100755
--- a/src/pairToBed/Makefile
+++ b/src/pairToBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS=	-lz
 
diff --git a/src/pairToPair/Makefile b/src/pairToPair/Makefile
index 80f356ad..60091e6d 100755
--- a/src/pairToPair/Makefile
+++ b/src/pairToPair/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
diff --git a/src/shuffleBed/Makefile b/src/shuffleBed/Makefile
index d917f3a5..c439ed89 100755
--- a/src/shuffleBed/Makefile
+++ b/src/shuffleBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS =  
 LIBS = -lz
 
diff --git a/src/slopBed/Makefile b/src/slopBed/Makefile
index e7b88d61..7cb1f1e5 100755
--- a/src/slopBed/Makefile
+++ b/src/slopBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS =  
 LIBS = -lz
 
diff --git a/src/sortBed/Makefile b/src/sortBed/Makefile
index 73e60076..542c0d39 100755
--- a/src/sortBed/Makefile
+++ b/src/sortBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
diff --git a/src/subtractBed/Makefile b/src/subtractBed/Makefile
index 701a5325..aef07ed2 100755
--- a/src/subtractBed/Makefile
+++ b/src/subtractBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
diff --git a/src/utils/BamTools/Makefile b/src/utils/BamTools/Makefile
index 20a41932..1bac7b53 100644
--- a/src/utils/BamTools/Makefile
+++ b/src/utils/BamTools/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 OBJ_DIR = ../../../obj/
 BIN_DIR = ../../../bin/
diff --git a/src/utils/bedFile/Makefile b/src/utils/bedFile/Makefile
index cbbd4d71..31bee672 100755
--- a/src/utils/bedFile/Makefile
+++ b/src/utils/bedFile/Makefile
@@ -1,5 +1,5 @@
 CXX = g++ -c
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 OBJ_DIR = ../../../obj/
 BIN_DIR = ../../../bin/
diff --git a/src/utils/bedFilePE/Makefile b/src/utils/bedFilePE/Makefile
index c1b9bff0..7927fc99 100755
--- a/src/utils/bedFilePE/Makefile
+++ b/src/utils/bedFilePE/Makefile
@@ -1,5 +1,5 @@
 CXX = g++ -c
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 OBJ_DIR = ../../../obj/
 BIN_DIR = ../../../bin/
diff --git a/src/utils/genomeFile/Makefile b/src/utils/genomeFile/Makefile
index 3f753f71..61d56693 100755
--- a/src/utils/genomeFile/Makefile
+++ b/src/utils/genomeFile/Makefile
@@ -1,5 +1,5 @@
 CXX = g++ -c
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 OBJ_DIR = ../../../obj/
 BIN_DIR = ../../../bin/
diff --git a/src/utils/gzstream/Makefile b/src/utils/gzstream/Makefile
new file mode 100644
index 00000000..d93607c6
--- /dev/null
+++ b/src/utils/gzstream/Makefile
@@ -0,0 +1,51 @@
+# ============================================================================
+# gzstream, C++ iostream classes wrapping the zlib compression library.
+# Copyright (C) 2001  Deepak Bandyopadhyay, Lutz Kettner
+# 
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# 
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# ============================================================================
+# 
+# File          : Makefile
+# Revision      : $Revision: 1.3 $
+# Revision_date : $Date: 2001/10/04 15:09:28 $
+# Author(s)     : Deepak Bandyopadhyay, Lutz Kettner
+# 
+# ============================================================================
+
+# ----------------------------------------------------------------------------
+# adapt these settings to your need:
+# add '-DGZSTREAM_NAMESPACE=name' to CPPFLAGS to place the classes
+# in its own namespace. Note, this macro needs to be set while creating
+# the library as well while compiling applications based on it.
+# As an alternative, gzstream.C and gzstream.h can be edited.
+# ----------------------------------------------------------------------------
+
+CXX = g++ 
+CXXFLAGS = -I. -O -Wall
+LDFLAGS  =  -L. -lgzstream -lz
+OBJ_DIR = ../../../obj/
+BIN_DIR = ../../../bin/
+UTILITIES_DIR = ../../utils/
+	
+${OBJ_DIR}/gzstream.o : gzstream.C gzstream.h
+	${CXX} ${CXXFLAGS} -c -o ${OBJ_DIR}/gzstream.o gzstream.C
+
+clean:
+	@echo "Cleaning up."
+	@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
+
+.PHONY: clean
+
+
diff --git a/src/utils/lineFileUtilities/Makefile b/src/utils/lineFileUtilities/Makefile
index fe18aa0b..875a191b 100755
--- a/src/utils/lineFileUtilities/Makefile
+++ b/src/utils/lineFileUtilities/Makefile
@@ -1,5 +1,5 @@
 CXX = g++ -c
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 OBJ_DIR = ../../../obj/
 BIN_DIR = ../../../bin/
diff --git a/src/utils/sequenceUtilities/Makefile b/src/utils/sequenceUtilities/Makefile
index 81d16bae..68138067 100755
--- a/src/utils/sequenceUtilities/Makefile
+++ b/src/utils/sequenceUtilities/Makefile
@@ -1,5 +1,5 @@
 CXX = g++ -c
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 OBJ_DIR = ../../../obj/
 BIN_DIR = ../../../bin/
diff --git a/src/windowBed/Makefile b/src/windowBed/Makefile
index 8ec6714b..9ec9013a 100755
--- a/src/windowBed/Makefile
+++ b/src/windowBed/Makefile
@@ -1,5 +1,5 @@
 CXX = g++
-CXXFLAGS = -O3  -Wall
+CXXFLAGS = -O2  -Wall
 LDFLAGS = 
 LIBS = -lz
 UTILITIES_DIR = ../utils/
-- 
GitLab