File: Makefile

package info (click to toggle)
yaha 0.1.83-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 117,156 kB
  • sloc: ansic: 3,816; cpp: 1,742; makefile: 44; sh: 14
file content (71 lines) | stat: -rw-r--r-- 1,775 bytes parent folder | download
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
# Determine the yaha build number
BUILDNUM := 83
# Decide if we are compiling for user mode, or internal lab usage.
# This almost exclusively determines the options available to the user when running YAHA.
# But also controls timing information.
USERMODE := TRUE

# Set up the sub-directory names.
SDIR := src
ODIR := obj
BDIR := bin

# Set up flags depending on mode
ifdef USERMODE
PROG	 := yaha
CFLAGS   ?= -Wall -O3 -D COMPILE_USER_MODE
CXXFLAGS ?= -Wall -O3 -D COMPILE_USER_MODE
else
PROG	 := yaha$(BUILDNUM)
CFLAGS   ?= -Wall -Winline -O3 -g
CXXFLAGS ?= -Wall -Winline -O3 -g
endif

CFLAGS   += -D BUILDNUM=$(BUILDNUM)

# Auto build dependency files.
CFLAGS   += -MMD -MP

CC	 ?= gcc
CXX      ?= g++
LDFLAGS  += -pthread

CXXFLAGS += -fpermissive

# The list of object files.
OBJfiles := Main.o AlignArgs.o AlignHelpers.o AlignExtFrag.o AlignOutput.o BaseSeq.o Compress.o \
	FileHelpers.o GraphPath.o Index.o Query.o QueryMatch.o QueryState.o SW.o Math.o
# Convert to use the obj dir
OBJS := $(patsubst %,$(ODIR)/%,$(OBJfiles))

# Make everything, all of which is defined below
YAHA: $(ODIR) $(BDIR) $(BDIR)/$(PROG)

# Make the directories
$(ODIR):
	mkdir -p $(ODIR)
$(BDIR):
	mkdir -p $(BDIR)

# Link the program
$(BDIR)/$(PROG): $(OBJS)
	$(CXX) $(LDFLAGS) -o $@ $(OBJS)

# Include the dependencies.
# The actual objects will be built by the below generic rules based on these dependencies.
# The - suppresses warning messages about missing files when building from scratch.
-include $(OBJS:.o=.d)

# Make the object files.
# The built in rules will miss the subdirectories. 
$(ODIR)/%.o: $(SDIR)/%.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

$(ODIR)/%.o: $(SDIR)/%.cpp
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@

.PHONY: clean
clean:
	rm -Rf $(ODIR)
	rm -Rf $(BDIR)