Debian Codegraph @

Makefile

raw ◀ ▶
1 Debian patch touch this file
1 # Example commands:
2 # make (build in release mode)
3 # make debug (build in debug mode)
4 # make clean (deletes *.o files, which aren't required to run the aligner)
5 # make distclean (deletes *.o files and the binary)
6 # make CXX=g++-5 (build with a particular compiler)
7 # make CXXFLAGS="-Werror -g3" (build with particular compiler flags)
8
9
10 # CXX and CXXFLAGS can be overridden by the user.
11 CXX ?= g++
12 CXXFLAGS ?= -Wall -Wextra -pedantic -mtune=native
13
14 # These flags are required for the build to work.
15 LIB = -lz
16 FLAGS = -std=c++11
17
18 # Different debug/optimisation levels for debug/release builds.
19 DEBUGFLAGS = -g
20 RELEASEFLAGS = -O3
21
22 TARGET = bin/filtlong
23 SHELL = /bin/sh
24 SOURCES = $(shell find src -name "*.cpp")
25 HEADERS = $(shell find src -name "*.h")
26 OBJECTS = $(SOURCES:.cpp=.o)
27
28 .PHONY: release
29 release: FLAGS+=$(RELEASEFLAGS)
30 release: $(TARGET)
31
32 .PHONY: debug
33 debug: FLAGS+=$(DEBUGFLAGS)
34 debug: $(TARGET)
35
36 dir_guard=@mkdir -p $(@D)
37
38 $(TARGET): $(OBJECTS)
39 $(dir_guard)
•40 $(CXX) $(CPPFLAGS) $(FLAGS) $(CXXFLAGS) -o $(TARGET) $(OBJECTS) $(LIB) $(LDFLAGS)
41
42 clean:
43 $(RM) $(OBJECTS)
44
45 distclean: clean
46 $(RM) $(TARGET)
47
48 %.o: %.cpp $(HEADERS)
•49 $(CXX) $(CPPFLAGS) $(FLAGS) $(CXXFLAGS) -c -o $@ $<