Makefile
1.28 KB
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
all: test
LIBS := -lpthread -lrt
EXECUTABLES := test
SRCS += \
src/Consumer.cpp \
src/DataBlock.cpp \
src/MemoryManager.cpp \
src/Producer.cpp \
src/Synchronizer.cpp \
src/shm.cpp \
src/wrflock_init.cpp \
src/wrflock_destroy.cpp \
src/wrflock_acquire.cpp \
src/wrflock_release.cpp \
src/wrflock_wait.cpp \
test.cpp
OBJS += \
build/Consumer.o \
build/DataBlock.o \
build/MemoryManager.o \
build/Producer.o \
build/Synchronizer.o \
build/shm.o \
build/wrflock_init.o \
build/wrflock_destroy.o \
build/wrflock_acquire.o \
build/wrflock_release.o \
build/wrflock_wait.o \
build/test.o
DEPS += \
build/Consumer.d \
build/DataBlock.d \
build/MemoryManager.d \
build/Producer.d \
build/Synchronizer.d \
build/shm.d \
build/wrflock_init.d \
build/wrflock_destroy.d \
build/wrflock_acquire.d \
build/wrflock_release.d \
build/wrflock_wait.d \
build/test.d
-include $(DEPS)
test: $(OBJS)
g++ -std=c++11 -o $@ $(OBJS) $(LIBS)
build/%.o: src/%.cpp
@mkdir -p build
g++ -std=c++11 -DNDEBUG -O3 -Isrc -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
build/%.o: %.cpp
@mkdir -p build
g++ -std=c++11 -DNDEBUG -O3 -Isrc -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
clean:
-rm $(EXECUTABLES) $(OBJS) $(DEPS)
-rmdir build
.PHONY: all clean dependents