-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
33 lines (26 loc) · 822 Bytes
/
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
CC=g++
CFLAGS=-c -g -Wall -Wextra -fno-strict-overflow -Wstrict-overflow=5 -std=c++11 -I./inc -I/usr/include/eigen3
LDFLAGS=
SOURCES=$(wildcard src/*.cpp) $(wildcard tests/*.cpp)
HEADERS=$(wildcard inc/etk/*.h)
OBJECTS=$(patsubst src/%.cpp,.obj/%.o,$(wildcard src/*.cpp))
TEST_OBJECTS=$(patsubst tests/%.cpp,.obj/tests/%.o,$(wildcard tests/*.cpp))
EXECUTABLE=bin/main
all: inc/etk/version.h $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS) $(TEST_OBJECTS)
mkdir -p bin
$(CC) $(LDFLAGS) $(OBJECTS) $(TEST_OBJECTS) -o $@
./bin/main
.obj/%.o:src/%.cpp
$(CC) $(CFLAGS) $< -o $@
.obj/tests/%.o:tests/%.cpp
mkdir -p .obj/tests
$(CC) $(CFLAGS) $< -o $@
inc/etk/version.h:
./autoversion
clean:
find . -name \*.o -execdir rm {} \;
rm -f $(EXECUTABLE)
rm inc/etk/version.h
install:
cp -rf ./inc/etk /usr/include