surpport seeking the recorded video
[vuplus_openembedded] / recipes / helloworld / helloworld_1.0.0.bb
1 DESCRIPTION = "Minimal statically compiled Hello world!"
2 LICENSE = "GPL"
3 PR = "r1"
4
5 S = "${WORKDIR}/${P}"
6
7 do_fetch () {
8         mkdir -p ${WORKDIR}/${P}
9         cd ${WORKDIR}/${P}
10         printf "#include <stdio.h>\nint main(void)\n{\n\tprintf(\"Hello world!\\\n\");\twhile(1);\n\treturn 0;\n}\n" >helloworld.c
11 }
12
13 do_compile () {
14         ${CC} ${CFLAGS} -c -o helloworld.o helloworld.c
15         ${CC} ${LDFLAGS} -o helloworld helloworld.o -static
16 }
17
18 do_install () {
19         install -d ${D}${bindir}
20         install -m 0755 helloworld ${D}${bindir}/
21         # /bin/init is on purpose, it is tried after /sbin/init and /etc/init
22         # so if a sysvinit is installed, it will be used instead of helloworld
23         install -d ${D}${base_bindir}
24         ln -sf ${bindir}/helloworld ${D}${base_bindir}/init
25 }