-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (62 loc) · 3.2 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
SRC_PREFIX=src/
BIN_PREFIX=bin/
OBJS_PREFIX=.objs/
CC=gcc
CFLAGS=-g -Wall -Wextra -std=c89 -O3
all: $(BIN_PREFIX)bio-alignment
UTILS_SRC_PREFIX=$(SRC_PREFIX)utils/
FASTA_SRC_PREFIX=$(SRC_PREFIX)fasta/
FASTA_SRC=$(shell find $(FASTA_SRC_PREFIX) -maxdepth 1 -name '*.c')
FASTA_OBJS_PREFIX=$(OBJS_PREFIX)fasta/
FASTA_OBJS=$(patsubst $(FASTA_SRC_PREFIX)%.c,$(FASTA_OBJS_PREFIX)%.o,$(FASTA_SRC))
$(FASTA_OBJS_PREFIX)%.o: $(FASTA_SRC_PREFIX)%.c $(FASTA_SRC_PREFIX)%.h
mkdir -p $(FASTA_OBJS_PREFIX)
$(CC) $(CFLAGS) -c $< -o $@
NW_SRC_PREFIX=$(SRC_PREFIX)needleman-wunsch/
NW_SRC=$(shell find $(NW_SRC_PREFIX) -maxdepth 1 -name '*.c')
NW_OBJS_PREFIX=$(OBJS_PREFIX)needleman-wunsch/
NW_OBJS=$(patsubst $(NW_SRC_PREFIX)%.c,$(NW_OBJS_PREFIX)%.o,$(NW_SRC))
$(NW_OBJS_PREFIX)%.o: $(NW_SRC_PREFIX)%.c $(NW_SRC_PREFIX)%.h
mkdir -p $(NW_OBJS_PREFIX)
$(CC) $(CFLAGS) -I$(UTILS_SRC_PREFIX) -c $< -o $@
SW_SRC_PREFIX=$(SRC_PREFIX)smith-waterman/
SW_SRC=$(shell find $(SW_SRC_PREFIX) -maxdepth 1 -name '*.c')
SW_OBJS_PREFIX=$(OBJS_PREFIX)smith-waterman/
SW_OBJS=$(patsubst $(SW_SRC_PREFIX)%.c,$(SW_OBJS_PREFIX)%.o,$(SW_SRC))
$(SW_OBJS_PREFIX)%.o: $(SW_SRC_PREFIX)%.c $(SW_SRC_PREFIX)%.h
mkdir -p $(SW_OBJS_PREFIX)
$(CC) $(CFLAGS) -I$(UTILS_SRC_PREFIX) -c $< -o $@
HB_SRC_PREFIX=$(SRC_PREFIX)hirschberg/
HB_SRC=$(shell find $(HB_SRC_PREFIX) -maxdepth 1 -name '*.c')
HB_OBJS_PREFIX=$(OBJS_PREFIX)hirschberg/
HB_OBJS=$(patsubst $(HB_SRC_PREFIX)%.c,$(HB_OBJS_PREFIX)%.o,$(HB_SRC))
$(HB_OBJS_PREFIX)%.o: $(HB_SRC_PREFIX)%.c $(HB_SRC_PREFIX)%.h
mkdir -p $(HB_OBJS_PREFIX)
$(CC) $(CFLAGS) -I$(UTILS_SRC_PREFIX) -I$(NW_SRC_PREFIX) -c $< -o $@
AF_SRC_PREFIX=$(SRC_PREFIX)affine/
AF_SRC=$(shell find $(AF_SRC_PREFIX) -maxdepth 1 -name '*.c')
AF_OBJS_PREFIX=$(OBJS_PREFIX)affine/
AF_OBJS=$(patsubst $(AF_SRC_PREFIX)%.c,$(AF_OBJS_PREFIX)%.o,$(AF_SRC))
$(AF_OBJS_PREFIX)%.o: $(AF_SRC_PREFIX)%.c $(AF_SRC_PREFIX)%.h
mkdir -p $(AF_OBJS_PREFIX)
$(CC) $(CFLAGS) -I$(UTILS_SRC_PREFIX) -I$(NW_SRC_PREFIX) -c $< -o $@
SCORING_FUNCTIONS_SRC_PREFIX=$(SRC_PREFIX)scoring-functions/
SCORING_FUNCTIONS_SRC=$(shell find $(SCORING_FUNCTIONS_SRC_PREFIX) -maxdepth 1 -name '*.c')
SCORING_FUNCTIONS_OBJS_PREFIX=$(OBJS_PREFIX)scoring-functions/
SCORING_FUNCTIONS_OBJS=$(patsubst $(SCORING_FUNCTIONS_SRC_PREFIX)%.c,$(SCORING_FUNCTIONS_OBJS_PREFIX)%.o,$(SCORING_FUNCTIONS_SRC))
$(SCORING_FUNCTIONS_OBJS_PREFIX)%.o: $(SCORING_FUNCTIONS_SRC_PREFIX)%.c $(SCORING_FUNCTIONS_SRC_PREFIX)%.h
mkdir -p $(SCORING_FUNCTIONS_OBJS_PREFIX)
$(CC) $(CFLAGS) -I$(UTILS_SRC_PREFIX) -c $< -o $@
MAIN_SRC_PREFIX=$(SRC_PREFIX)
MAIN_SRC=$(shell find $(MAIN_SRC_PREFIX) -maxdepth 1 -name '*.c')
MAIN_OBJS_PREFIX=$(OBJS_PREFIX)
MAIN_OBJS=$(patsubst $(MAIN_SRC_PREFIX)%.c,$(MAIN_OBJS_PREFIX)%.o,$(MAIN_SRC))
$(MAIN_OBJS_PREFIX)%.o: $(MAIN_SRC_PREFIX)%.c
mkdir -p $(MAIN_OBJS_PREFIX)
$(CC) $(CFLAGS) -I$(FASTA_SRC_PREFIX) -I$(NW_SRC_PREFIX) -I$(SW_SRC_PREFIX) -I$(HB_SRC_PREFIX) -I$(AF_SRC_PREFIX) -I$(SCORING_FUNCTIONS_SRC_PREFIX) -I$(UTILS_SRC_PREFIX) -c $< -o $@
$(BIN_PREFIX)bio-alignment: $(FASTA_OBJS) $(NW_OBJS) $(SW_OBJS) $(HB_OBJS) $(AF_OBJS) $(MAIN_OBJS) $(SCORING_FUNCTIONS_OBJS)
mkdir -p $(BIN_PREFIX)
$(CC) $(CFLAGS) -I$(UTILS_SRC_PREFIX) $^ -o $@
.PHONY: clean
clean:
rm -rf $(BIN_PREFIX) $(OBJS_PREFIX)