aboutsummaryrefslogtreecommitdiff
path: root/recipes-demo/de10-nano-adxl-apps/de10-nano-adxl-apps.bb
blob: c301cfc42aec422248da501366f826c499c3cd6d (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
SUMMARY = "Example applications for DE10-Nano accelerometer"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d252b8b27e3e6ea89c9c6912b3c4373d"

PACKAGE_ARCH = "${MACHINE_ARCH}" 

PR = "r0"

SRC_URI = "\
	file://adxl_calibrate.sh \
	file://build_bubble_demo.sh \
	file://build_tap_detect.sh \
	file://build_watch_adxl.sh \
	file://LICENSE \
	file://bubble_demo.c \
	file://README_SANDBOX.txt \
	file://README_SRC.txt \
	file://tap_detect.c \
	file://watch_adxl.c \
"

ADXL_BIN_FILES  = "bubble_demo"

ADXL_SRC_FILES  = "build_bubble_demo.sh"
ADXL_SRC_FILES += "LICENSE"
ADXL_SRC_FILES += "bubble_demo.c"
ADXL_SRC_FILES += "README_SRC.txt"

ADXL_SANDBOX_FILES  = "adxl_calibrate.sh"
ADXL_SANDBOX_FILES += "build_tap_detect.sh"
ADXL_SANDBOX_FILES += "build_watch_adxl.sh"
ADXL_SANDBOX_FILES += "LICENSE"
ADXL_SANDBOX_FILES += "README_SANDBOX.txt"
ADXL_SANDBOX_FILES += "tap_detect.c"
ADXL_SANDBOX_FILES += "watch_adxl.c"

S = "${WORKDIR}"

do_configure () {

	rm -f bubble_demo
}
do_compile () {

	${CC} \
		-march=armv7-a \
		-mfloat-abi=hard \
		-mfpu=vfp3 \
		-mthumb-interwork \
		-mthumb \
		-O2 -D_FORTIFY_SOURCE=2 \
		-g \
		-feliminate-unused-debug-types  \
		-std=gnu99 \
		-W \
		-Wall \
		-Werror \
		-Wc++-compat \
		-Wwrite-strings \
		-Wstrict-prototypes \
		-Wformat -Wformat-security \
		-pedantic \
		-fstack-protector-strong \
		-z noexecstack \
		-z relro -z now \
		-o "bubble_demo" \
		"bubble_demo.c"
}

do_install () {
	
	cd ${S}

	install -d ${D}/examples/adxl/bin
	cp -a ${ADXL_BIN_FILES} ${D}/examples/adxl/bin

	install -d ${D}/examples/adxl/src
	cp -a ${ADXL_SRC_FILES} ${D}/examples/adxl/src

	install -d ${D}/examples/adxl/sandbox
	cp -a ${ADXL_SANDBOX_FILES} ${D}/examples/adxl/sandbox

	rm -f adxl_src.tgz
	tar czf adxl_src.tgz -C ${D}/examples/adxl/src ${ADXL_SRC_FILES}
	cp -a adxl_src.tgz ${D}/examples/adxl

	rm -f adxl_sandbox.tgz
	tar czf adxl_sandbox.tgz -C ${D}/examples/adxl/sandbox ${ADXL_SANDBOX_FILES}
	cp -a adxl_sandbox.tgz ${D}/examples/adxl
}

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
PACKAGES = "${PN}"
FILES_${PN} += "examples/adxl/"