-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 779 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (23 loc) · 779 Bytes
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
CXXFLAGS=$(shell pkg-config --cflags libjpeg)
LDFLAGS=$(shell pkg-config --libs libjpeg)
DEBUG_FLAGS=-ggdb3 -O0 -DDEBUG
FILES=src/io.cpp src/main.cpp src/tiff.cpp src/crx.cpp src/jpeg.cpp src/ljpeg.cpp src/ppm.cpp
OBJECTS=$(subst src/,build/,$(FILES:.cpp=.o))
default: cora
release: DEBUG_FLAGS =
release: cora
asan: CXXFLAGS += -g3 -O0 -rdynamic -fno-omit-frame-pointer -fsanitize=address
asan: LDFLAGS += -Wl,--export-dynamic -fsanitize=address -lbfd -ldw
asan: cora
profile: CXXFLAGS += -g3 -O3 -rdynamic
profile: LDFLAGS += -Wl,--export-dynamic
profile: cora
clean:
rm -r build
build/%.o: src/%.cpp
g++ $(CXXFLAGS) $(DEBUG_FLAGS) $^ -c -o $@
cora: build $(OBJECTS)
g++ $(LDFLAGS) $(DEBUG_FLAGS) $(OBJECTS) -o $@
build:
mkdir build
.PHONY: default release asan