Compare commits
No commits in common. "ba238692a4a3ca16529d9512fcca5a4f547ce5d3" and "ceffdfb561c126753084581060f06468b354ac3a" have entirely different histories.
ba238692a4
...
ceffdfb561
28
README.md
28
README.md
@ -1,28 +0,0 @@
|
|||||||
|
|
||||||
# example-projects
|
|
||||||
|
|
||||||
## Yocto
|
|
||||||
|
|
||||||
### Add layer in a Yocto project
|
|
||||||
|
|
||||||
```
|
|
||||||
bitbake-layers add-layer /path/to/meta-helloworld
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add this to `build/conf/local.conf`:
|
|
||||||
```sh
|
|
||||||
IMAGE_INSTALL:append = " helloworld-c-make"
|
|
||||||
IMAGE_INSTALL:append = " helloworld-cpp-cmake"
|
|
||||||
IMAGE_INSTALL:append = " helloworld-rs"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Add/create recipes in a Yocto project
|
|
||||||
|
|
||||||
```
|
|
||||||
devtool add helloworld-c-make git@bitbucket.org:dol-sensors/example-projects.git --srcbranch main --src-subdir helloworld-c-make
|
|
||||||
|
|
||||||
devtool add helloworld-cpp-cmake git@bitbucket.org:dol-sensors/example-projects.git --srcbranch main --src-subdir helloworld-cpp-cmake
|
|
||||||
|
|
||||||
devtool add helloworld-rs git@bitbucket.org:dol-sensors/example-projects.git --srcbranch main --src-subdir helloworld-rs
|
|
||||||
```
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
BasedOnStyle: WebKit
|
|
||||||
IndentWidth: 4
|
|
||||||
ColumnLimit: 80
|
|
||||||
IndentCaseLabels: true
|
|
||||||
BreakBeforeBraces: Custom
|
|
||||||
BraceWrapping:
|
|
||||||
AfterFunction: true
|
|
||||||
SplitEmptyFunction: false
|
|
||||||
AlignAfterOpenBracket: BlockIndent
|
|
||||||
AlignOperands: AlignAfterOperator
|
|
||||||
BreakBeforeBinaryOperators: true
|
|
||||||
BinPackArguments: false
|
|
||||||
BinPackParameters: false
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
CompileFlags:
|
|
||||||
CompilationDatabase: build/compile_flags.txt
|
|
||||||
Remove:
|
|
||||||
- -Wempty-translation-unit
|
|
||||||
|
|
3
helloworld-c-make/.gitignore
vendored
3
helloworld-c-make/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
build/
|
|
||||||
.cache/
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
|||||||
|
|
||||||
EXECUTABLE = helloworld-c-make
|
|
||||||
|
|
||||||
CFLAGS = -std=c17 -Wall -Wextra -pedantic -pedantic-errors -O2
|
|
||||||
|
|
||||||
SOURCE_FILES = \
|
|
||||||
src/main.c
|
|
||||||
|
|
||||||
OBJECT_FILES = $(patsubst src/%.c, build/%.o, $(SOURCE_FILES))
|
|
||||||
|
|
||||||
HEADER_FILES = $(shell find src/ -name *.h)
|
|
||||||
|
|
||||||
all: build/$(EXECUTABLE) build/compile_flags.txt
|
|
||||||
|
|
||||||
build/$(EXECUTABLE): $(OBJECT_FILES)
|
|
||||||
$(CC) -o $@ $(LDFLAGS) $^
|
|
||||||
|
|
||||||
build/%.o: src/%.c $(HEADER_FILES) build-folder
|
|
||||||
$(CC) -c -o $@ $(CFLAGS) $<
|
|
||||||
|
|
||||||
build-folder:
|
|
||||||
mkdir -p build/
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf build/
|
|
||||||
|
|
||||||
build/compile_flags.txt:
|
|
||||||
echo -xc $(CFLAGS) \
|
|
||||||
| tr ' ' '\n' \
|
|
||||||
> $@
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
# helloworld-c-make
|
|
||||||
|
|
||||||
```
|
|
||||||
make
|
|
||||||
./build/helloworld-c-make
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
make
|
|
||||||
|
|
||||||
sudo cp build/helloworld-c-make /usr/local/bin/
|
|
||||||
|
|
||||||
helloworld-c-make
|
|
||||||
```
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(void) { printf("Hello, world!\n"); }
|
|
@ -1,14 +0,0 @@
|
|||||||
BasedOnStyle: WebKit
|
|
||||||
IndentWidth: 4
|
|
||||||
ColumnLimit: 80
|
|
||||||
IndentCaseLabels: true
|
|
||||||
BreakBeforeBraces: Custom
|
|
||||||
BraceWrapping:
|
|
||||||
AfterFunction: true
|
|
||||||
SplitEmptyFunction: false
|
|
||||||
AlignAfterOpenBracket: BlockIndent
|
|
||||||
AlignOperands: AlignAfterOperator
|
|
||||||
BreakBeforeBinaryOperators: true
|
|
||||||
BinPackArguments: false
|
|
||||||
BinPackParameters: false
|
|
||||||
|
|
3
helloworld-cpp-cmake/.gitignore
vendored
3
helloworld-cpp-cmake/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
build/
|
|
||||||
.cache/
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 3.22)
|
|
||||||
project(MyProject VERSION 1.0.0 LANGUAGES C CXX)
|
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
|
|
||||||
|
|
||||||
add_executable(
|
|
||||||
helloworld-cpp-cmake
|
|
||||||
src/main.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
install(TARGETS helloworld-cpp-cmake)
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# helloworld-cpp-cmake
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake ..
|
|
||||||
make
|
|
||||||
./helloworld-cpp-cmake
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -CMAKE_BUILD_TYPE=Release
|
|
||||||
make
|
|
||||||
sudo make install
|
|
||||||
./helloworld-cpp-cmake
|
|
||||||
```
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main() { std::cout << "Hello, world!\n"; }
|
|
@ -8,8 +8,4 @@ cargo run
|
|||||||
```sh
|
```sh
|
||||||
cargo build --release
|
cargo build --release
|
||||||
./target/release/helloworld-rs
|
./target/release/helloworld-rs
|
||||||
|
``´
|
||||||
cargo install --path .
|
|
||||||
|
|
||||||
cargo install --path . --root /usr/local
|
|
||||||
```
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
@ -1,41 +0,0 @@
|
|||||||
This README file contains information on the contents of the meta-helloworld layer.
|
|
||||||
|
|
||||||
Please see the corresponding sections below for details.
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
============
|
|
||||||
|
|
||||||
URI: <first dependency>
|
|
||||||
branch: <branch name>
|
|
||||||
|
|
||||||
URI: <second dependency>
|
|
||||||
branch: <branch name>
|
|
||||||
|
|
||||||
.
|
|
||||||
.
|
|
||||||
.
|
|
||||||
|
|
||||||
Patches
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please submit any patches against the meta-helloworld layer to the xxxx mailing list (xxxx@zzzz.org)
|
|
||||||
and cc: the maintainer:
|
|
||||||
|
|
||||||
Maintainer: XXX YYYYYY <xxx.yyyyyy@zzzzz.com>
|
|
||||||
|
|
||||||
Table of Contents
|
|
||||||
=================
|
|
||||||
|
|
||||||
I. Adding the meta-helloworld layer to your build
|
|
||||||
II. Misc
|
|
||||||
|
|
||||||
|
|
||||||
I. Adding the meta-helloworld layer to your build
|
|
||||||
=================================================
|
|
||||||
|
|
||||||
Run 'bitbake-layers add-layer meta-helloworld'
|
|
||||||
|
|
||||||
II. Misc
|
|
||||||
========
|
|
||||||
|
|
||||||
--- replace with specific information about the meta-helloworld layer ---
|
|
@ -1,13 +0,0 @@
|
|||||||
# We have a conf and classes directory, add to BBPATH
|
|
||||||
BBPATH .= ":${LAYERDIR}"
|
|
||||||
|
|
||||||
# We have recipes-* directories, add to BBFILES
|
|
||||||
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
|
|
||||||
${LAYERDIR}/recipes-*/*/*.bbappend"
|
|
||||||
|
|
||||||
BBFILE_COLLECTIONS += "helloworld"
|
|
||||||
BBFILE_PATTERN_helloworld = "^${LAYERDIR}/"
|
|
||||||
BBFILE_PRIORITY_helloworld = "6"
|
|
||||||
|
|
||||||
LAYERDEPENDS_helloworld = "core"
|
|
||||||
LAYERSERIES_COMPAT_helloworld = "kirkstone"
|
|
@ -1,13 +0,0 @@
|
|||||||
SUMMARY = "bitbake-layers recipe"
|
|
||||||
DESCRIPTION = "Recipe created by bitbake-layers"
|
|
||||||
LICENSE = "MIT"
|
|
||||||
|
|
||||||
python do_display_banner() {
|
|
||||||
bb.plain("***********************************************");
|
|
||||||
bb.plain("* *");
|
|
||||||
bb.plain("* Example recipe created by bitbake-layers *");
|
|
||||||
bb.plain("* *");
|
|
||||||
bb.plain("***********************************************");
|
|
||||||
}
|
|
||||||
|
|
||||||
addtask display_banner before do_build
|
|
@ -1,26 +0,0 @@
|
|||||||
|
|
||||||
# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if
|
|
||||||
# this is not accurate with respect to the licensing of the software being built (it
|
|
||||||
# will not be in most cases) you must specify the correct value before using this
|
|
||||||
# recipe for anything other than initial testing/development!
|
|
||||||
LICENSE = "CLOSED"
|
|
||||||
LIC_FILES_CHKSUM = ""
|
|
||||||
|
|
||||||
SRC_URI = "git://git@bitbucket.org/dol-sensors/example-projects.git;protocol=ssh;branch=main"
|
|
||||||
|
|
||||||
PV = "1.0+git${SRCPV}"
|
|
||||||
SRCREV = "5f94ed3ba1bff1c6631d0234c7dbe65c27c4791e"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/git/${BPN}"
|
|
||||||
|
|
||||||
do_compile () {
|
|
||||||
oe_runmake
|
|
||||||
}
|
|
||||||
|
|
||||||
do_install () {
|
|
||||||
install -d ${D}${bindir}
|
|
||||||
install -m 0755 ${S}/build/helloworld-c-make ${D}${bindir}
|
|
||||||
}
|
|
||||||
|
|
||||||
FILES:${PN} += "${bindir}"
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
# Recipe created by recipetool
|
|
||||||
# This is the basis of a recipe and may need further editing in order to be fully functional.
|
|
||||||
# (Feel free to remove these comments when editing.)
|
|
||||||
|
|
||||||
# Unable to find any files that looked like license statements. Check the accompanying
|
|
||||||
# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.
|
|
||||||
#
|
|
||||||
# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if
|
|
||||||
# this is not accurate with respect to the licensing of the software being built (it
|
|
||||||
# will not be in most cases) you must specify the correct value before using this
|
|
||||||
# recipe for anything other than initial testing/development!
|
|
||||||
LICENSE = "CLOSED"
|
|
||||||
LIC_FILES_CHKSUM = ""
|
|
||||||
|
|
||||||
SRC_URI = "git://git@bitbucket.org/dol-sensors/example-projects.git;protocol=ssh;branch=main"
|
|
||||||
|
|
||||||
# Modify these as desired
|
|
||||||
PV = "1.0+git${SRCPV}"
|
|
||||||
SRCREV = "5f94ed3ba1bff1c6631d0234c7dbe65c27c4791e"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/git/${BPN}"
|
|
||||||
|
|
||||||
inherit cmake
|
|
||||||
|
|
||||||
# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
|
|
||||||
EXTRA_OECMAKE = ""
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
# Recipe created by recipetool
|
|
||||||
# This is the basis of a recipe and may need further editing in order to be fully functional.
|
|
||||||
# (Feel free to remove these comments when editing.)
|
|
||||||
|
|
||||||
# Unable to find any files that looked like license statements. Check the accompanying
|
|
||||||
# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.
|
|
||||||
#
|
|
||||||
# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if
|
|
||||||
# this is not accurate with respect to the licensing of the software being built (it
|
|
||||||
# will not be in most cases) you must specify the correct value before using this
|
|
||||||
# recipe for anything other than initial testing/development!
|
|
||||||
LICENSE = "CLOSED"
|
|
||||||
LIC_FILES_CHKSUM = ""
|
|
||||||
|
|
||||||
SRC_URI = "git://git@bitbucket.org/dol-sensors/example-projects.git;protocol=ssh;branch=main"
|
|
||||||
|
|
||||||
# Modify these as desired
|
|
||||||
PV = "1.0+git${SRCPV}"
|
|
||||||
SRCREV = "5f94ed3ba1bff1c6631d0234c7dbe65c27c4791e"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/git/${BPN}"
|
|
||||||
|
|
||||||
inherit cargo
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user