-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
101 lines (74 loc) · 3.11 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# MAX. K-MER LENGTH, NUMBER OF FILES
CC = g++ -O3 -march=native -DmaxK=32 -DmaxN=64 -std=c++14
XX = -lpthread -lz
## IF DEBUG
# CC = g++ -g -march=native -DmaxK=32 -DmaxN=64 -std=c++14
## IF BIFROST LIBRARY SHOULD BE USED
# CC = g++ -O3 -march=native -DmaxK=32 -DmaxN=64 -DuseBF -std=c++14
# XX = -lbifrost -lpthread -lz
# GZ STREAM LIB
CFLAGS = gcc -O3 -march=native
# Directories
SRCDIR := src
BUILDDIR := obj
# Wrap Windows / Unix commands
ifeq ($(OS), Windows_NT)
TD = $(BUILDDIR)
MK = rmdir /s /q $(BUILDDIR) && mkdir $(BUILDDIR)
RM = rmdir /s /q $(BUILDDIR)
MV = cmd /C move *.o $(BUILDDIR)
CP = cp makefile $(BUILDDIR)
else
TD = $(BUILDDIR)/
MK = mkdir -p $(BUILDDIR)/
RM = rm -rf $(BUILDDIR)/
MV = mv *.o $(BUILDDIR)/
CP = cp makefile $(BUILDDIR)/makefile
endif
ifeq ("$(wildcard $(TD))", "")
RM = @echo ""
endif
all: makefile start SANS done
SANS: makefile $(BUILDDIR)/main.o
$(CC) -o SANS $(BUILDDIR)/nexus_color.o $(BUILDDIR)/main.o $(BUILDDIR)/graph.o $(BUILDDIR)/kmer.o $(BUILDDIR)/kmerAmino.o $(BUILDDIR)/color.o $(BUILDDIR)/util.o $(BUILDDIR)/translator.o $(BUILDDIR)/cleanliness.o $(BUILDDIR)/gzstream.o $(XX)
$(BUILDDIR)/main.o: makefile $(SRCDIR)/main.cpp $(SRCDIR)/main.h $(BUILDDIR)/color.o $(BUILDDIR)/translator.o $(BUILDDIR)/graph.o $(BUILDDIR)/util.o $(BUILDDIR)/cleanliness.o $(BUILDDIR)/gzstream.o $(BUILDDIR)/nexus_color.o
$(CC) -c $(SRCDIR)/main.cpp -o $(BUILDDIR)/main.o
$(BUILDDIR)/graph.o: makefile $(SRCDIR)/graph.cpp $(SRCDIR)/graph.h $(BUILDDIR)/kmer.o $(BUILDDIR)/kmerAmino.o $(BUILDDIR)/color.o
$(CC) -c $(SRCDIR)/graph.cpp -o $(BUILDDIR)/graph.o
$(BUILDDIR)/kmer.o: makefile $(SRCDIR)/kmer.cpp $(SRCDIR)/kmer.h $(BUILDDIR)/util.o
$(CC) -c $(SRCDIR)/kmer.cpp -o $(BUILDDIR)/kmer.o
$(BUILDDIR)/kmerAmino.o: makefile $(SRCDIR)/kmerAmino.cpp $(SRCDIR)/kmerAmino.h $(BUILDDIR)/util.o
$(CC) -c $(SRCDIR)/kmerAmino.cpp -o $(BUILDDIR)/kmerAmino.o
$(BUILDDIR)/color.o: makefile $(SRCDIR)/color.cpp $(SRCDIR)/color.h
$(CC) -c $(SRCDIR)/color.cpp -o $(BUILDDIR)/color.o
$(BUILDDIR)/nexus_color.o: makefile $(SRCDIR)/nexus_color.cpp $(SRCDIR)/nexus_color.h
$(CC) -c $(SRCDIR)/nexus_color.cpp -o $(BUILDDIR)/nexus_color.o
$(BUILDDIR)/util.o: $(SRCDIR)/util.cpp $(SRCDIR)/util.h
$(CC) -c $(SRCDIR)/util.cpp -o $(BUILDDIR)/util.o
$(BUILDDIR)/translator.o: $(SRCDIR)/translator.cpp $(SRCDIR)/translator.h $(SRCDIR)/gc.h
$(CC) -c $(SRCDIR)/translator.cpp -o $(BUILDDIR)/translator.o
$(BUILDDIR)/cleanliness.o: $(SRCDIR)/cleanliness.cpp $(SRCDIR)/cleanliness.h
$(CC) -c $(SRCDIR)/cleanliness.cpp -o $(BUILDDIR)/cleanliness.o
$(BUILDDIR)/gzstream.o: $(SRCDIR)/gz/gzstream.C $(SRCDIR)/gz/gzstream.h
$(CFLAGS) -c $(SRCDIR)/gz/gzstream.C -o $(BUILDDIR)/gzstream.o
# [Internal rules]
# Print info at compile start
start:
@echo "";
@echo " ________________________________";
@echo " <<< BUILDING SANS AMBAGES >>> ";
@echo " ________________________________";
@echo "";
@$(MK)
# Print info when done
done:
@echo "";
@echo " _______________";
@echo " <<< Done! >>> ";
@echo " _______________";
@echo "";
# [Remove current build files]
.PHONY: clean
# Remove build files
clean:
$(RM)