forked from teharrison/skewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (39 loc) · 945 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
CXX=g++
DEBUG?=0
CXXFLAGS?=-c
LDFLAGS=-pthread
LDLIBS=-lrt
ifneq ($(OS), Windows_NT)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Darwin)
LDFLAGS=-lpthread
LDLIBS=
endif
endif
SRC=src
SOURCES=$(SRC)/main.cpp $(SRC)/parameter.cpp $(SRC)/matrix.cpp $(SRC)/fastq.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=skewer
ifeq ($(DEBUG), 1)
CXXFLAGS += -O0 -g -Wall -D_DEBUG
else
CXXFLAGS += -O2
endif
.PHONY: all debug clean
all:$(EXECUTABLE)
debug:
$(MAKE) $(MAKEFILE) DEBUG=1
$(EXECUTABLE):$(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) -o $@ $(LDLIBS)
.cpp.o:
$(CXX) $(CXXFLAGS) $< -o $@
$(SRC)/main.o: $(SRC)/parameter.h $(SRC)/matrix.h $(SRC)/fastq.h $(SRC)/common.h
$(SRC)/parameter.o: $(SRC)/parameter.h $(SRC)/fastq.h $(SRC)/common.h
$(SRC)/matrix.o: $(SRC)/matrix.h $(SRC)/common.h
$(SRC)/fastq.o: $(SRC)/fastq.h $(SRC)/common.h
# Clean
clean:
rm -rf $(OBJECTS) $(EXECUTABLE)
# Install
install:
mv -f $(EXECUTABLE) /usr/local/bin