Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / helloworld / helloworld_1.0.0.bb
1 DESCRIPTION = "Minimal statically compiled Hello world!"
2 LICENSE = "GPL"
3 FILE_PR = "r0"
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} -o helloworld helloworld.c -static
15 }
16
17 do_install () {
18         install -d ${D}${bindir}
19         install -m 0755 helloworld ${D}${bindir}/
20         # /bin/init is on purpose, it is tried after /sbin/init and /etc/init
21         # so if a sysvinit is installed, it will be used instead of helloworld
22         install -d ${D}${base_bindir}
23         ln -sf ${bindir}/helloworld ${D}${base_bindir}/init
24 }