-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong include and refactor Makefile to build cleanly on macOS (#146)
* Fix wrong included file * Refactor makefile and fix it to build cleanly on macOS
- Loading branch information
1 parent
f119872
commit b014034
Showing
2 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
C++ = g++ | ||
CFLAGS = -c -g -O3 -pedantic -std=c++11 -fopenmp | ||
CXXFLAGS := -c -g -O3 -pedantic -std=c++11 | ||
|
||
all: kmer_counter | ||
UNAME_S := $(shell uname -s) | ||
ifeq ($(UNAME_S),Darwin) | ||
CXX := clang++ | ||
else | ||
CXX := g++ | ||
endif | ||
|
||
kmer_counter: kmer2read_distr.o ctime.o taxonomy.o kraken_processing.o | ||
$(C++) -o kmer2read_distr ctime.o kmer2read_distr.o taxonomy.o kraken_processing.o -lgomp | ||
IS_CLANG := $(findstring clang++,$(CXX)) | ||
ifeq ($(IS_CLANG),clang++) | ||
CXXFLAGS += -Xpreprocessor -fopenmp | ||
LDFLAGS += -lomp | ||
else | ||
CXXFLAGS += -fopenmp | ||
LDFLAGS += -lgomp | ||
endif | ||
|
||
all: kmer2read_distr | ||
|
||
kmer2read_distr: kmer2read_distr.o ctime.o taxonomy.o kraken_processing.o | ||
$(CXX) -o $@ $^ $(LDFLAGS) | ||
|
||
clean: | ||
rm -f *.o | ||
rm -f *.o | ||
|
||
%.o: %.cpp | ||
$(CXX) $(CXXFLAGS) $< | ||
|
||
%.o: %.cpp | ||
$(C++) $(CFLAGS) $*.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* Jennifer Lu, [email protected] | ||
* Updated: 2018/09/06 | ||
*/ | ||
#include "time.h" | ||
#include "ctime.h" | ||
|
||
/************************************************************************* | ||
* METHOD: timeval_subtract | ||
|