-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
77 lines (60 loc) · 1.88 KB
/
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
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
72
73
74
75
76
77
## change prefix to build for other platforms
#GCC_PREFIX = avr32-linux-
GCC_PREFIX =
include Makefile.paths
CXX=$(GCC_PREFIX)g++
AR=$(GCC_PREFIX)ar
CC=$(GCC_PREFIX)gcc
OPTIMIZATION=-O2
CXXFLAGS+=$(OPTIMIZATION) -Wall
OPENAHRS_PATH = $(realpath ./openAHRS)
OPENAHRS_LIB = $(OPENAHRS_PATH)/openAHRS.a
OPENAHRS_INC = $(OPENAHRS_PATH)/include
## change that if you want to try floating point results
FLOAT_TYPE=double
## Prepare basic build variables
all: openAHRS/openAHRS.a
@echo done.
openAHRS/openAHRS.a: Makefile.build
@echo ---=== Compiling openAHRS ===---
make -C openAHRS
test-kal7: openAHRS/openAHRS.a Makefile.build
@echo ---=== Building test-kal7 ===---
make -C tests/test-kal7
test-eigen2: Makefile.build
@echo ---=== Building test-eigen2 ===---
make -C tests/test-eigen2
##prepare neccesary files for build
Makefile.build: Makefile
@echo EIGENPATH=$(realpath $(EIGENPATH)) > Makefile.build
@echo CXXFLAGS += -DFT=$(FLOAT_TYPE) >> Makefile.build
@echo CXX=$(CXX) >> Makefile.build
@echo AR=$(AR) >> Makefile.build
@echo CC=$(CC) >> Makefile.build
@echo CXXFLAGS +=$(CXXFLAGS) >> Makefile.build
@echo OPENAHRS_LIB = $(OPENAHRS_LIB) >> Makefile.build
@echo OPENAHRS_INC = $(OPENAHRS_INC) >> Makefile.build
clean: Makefile.build
make clean -C tests/test-kal7
make clean -C tests/test-ukfkal7
make clean -C tests/test-calib-ellipsoid
make clean -C tests/test-calib-ukfellipsoid
make clean -C openAHRS
make clean -C AHRSs
rm Makefile.build
help:
@echo
@echo ___--=== openAHRS Makefile ===--___
@echo
@echo CAUTION: Please setup the EIGENPATH variable in Makefile.paths first!!
@echo
@echo
@echo == To compile the main library just type \'make\' with no arguments.
@echo
@echo == To compile examples you can try \'make example_name\'
@echo where example_name is one of
@echo
@echo test-eigen2
@echo test-kal7
@echo
.PHONY: tests test-kal7 help openAHRS/openAHRS.a