From d8ca8e5bc9383255f32b23db8f702b941d65e340 Mon Sep 17 00:00:00 2001 From: Rob Long Date: Fri, 7 Dec 2012 11:01:00 -0600 Subject: [PATCH 1/3] Remove original Makefile, update .gitignore, add CMakeLists.txt --- .gitignore | 7 ++++++- CMakeLists.txt | 15 +++++++++++++++ Makefile | 19 ------------------- 3 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 9c2ec17..49f9f4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ *.o -fastahack \ No newline at end of file +fastahack +libfastahack.a +CMakeFiles +CMakeCache.txt +cmake_install.cmake +Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4727546 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(fastahck + FastaHack.cpp + Fasta.cpp + split.cpp + disorder.c +) + +add_executable(fastahack + FastaHack.cpp + disorder.c +) + +target_link_libraries(fastahack + fastahck +) diff --git a/Makefile b/Makefile deleted file mode 100644 index b0d847e..0000000 --- a/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -CXX=g++ -CFLAGS=-O3 -D_FILE_OFFSET_BITS=64 - -fastahack: Fasta.o FastaHack.cpp split.o disorder.o - $(CXX) $(CFLAGS) Fasta.o FastaHack.cpp split.o disorder.o -o fastahack - -Fasta.o: Fasta.h Fasta.cpp - $(CXX) $(CFLAGS) -c Fasta.cpp - -split.o: split.h split.cpp - $(CXX) $(CFLAGS) -c split.cpp - -disorder.o: disorder.c disorder.h - $(CXX) $(CFLAGS) -c disorder.c - -clean: - rm -f fastahack *.o - -.PHONY: clean From b6488c8083a6c06c5af6cd5e4edac0915feda1c1 Mon Sep 17 00:00:00 2001 From: Rob Long Date: Fri, 7 Dec 2012 11:02:35 -0600 Subject: [PATCH 2/3] Specify disorder.c include as extern --- FastaHack.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FastaHack.cpp b/FastaHack.cpp index fac0963..b542abc 100644 --- a/FastaHack.cpp +++ b/FastaHack.cpp @@ -1,7 +1,9 @@ #include "Fasta.h" #include #include +extern "C" { #include "disorder.h" +} void printSummary() { cerr << "usage: fastahack [options] " << endl From 18b6b87207c3764c000a4e9dadbfa7e7d5dce8a3 Mon Sep 17 00:00:00 2001 From: Rob Long Date: Fri, 7 Dec 2012 12:12:42 -0600 Subject: [PATCH 3/3] updated README and resolved a naming conflict in CMakeLists.txt --- CMakeLists.txt | 14 ++++++++++---- README | 9 +++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4727546..e556379 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,21 @@ -add_library(fastahck +cmake_minimum_required(VERSION 2.8) + +add_library(fastahack FastaHack.cpp Fasta.cpp split.cpp disorder.c ) -add_executable(fastahack +add_executable(fastahack-bin FastaHack.cpp disorder.c ) -target_link_libraries(fastahack - fastahck +set_target_properties(fastahack-bin + PROPERTIES OUTPUT_NAME fastahack +) + +target_link_libraries(fastahack-bin + fastahack ) diff --git a/README b/README index 5ccba37..7d82aa5 100644 --- a/README +++ b/README @@ -25,6 +25,15 @@ extraction without RAM-intensive file loading operations. This makes fastahack a useful tool for bioinformaticists who need to quickly extract many subsequences from a reference FASTA sequence. +Build: + +Cmake is required to build this project. Issue the following commands from the +fastahack director: + + % cmake . + % make + + Notes: