aboutsummaryrefslogtreecommitdiffstats
path: root/libs/nanopb/extra/nanopb.mk
blob: 5c2cff560c5df5210b96d983085b06d6a3c5e86f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
1
# Desktop packages for binder development

Packages of the ***binder*** (afb-daemon)exist
for common desktop linux distributions.

- Fedora
- Ubuntu
- Debian
- Suse

Installing the development package of the ***binder***
allows to write ***bindings*** that runs on the desktop
computer of the developer.

It is very convenient to quickly write and debug a binding.

## Retrieving compiling option with pkg-config

The ***binder*** afb-daemon provides a configuration
file for **pkg-config**.  
Typing the command

```bash
pkg-config --cflags afb-daemon
```

Print flags use for compilation:

```bash
$ pkg-config --cflags afb-daemon
-I/opt/local/include -I/usr/include/json-c
```

For linking, you should use

```bash
$ pkg-config --libs afb-daemon
-ljson-c
```

It automatically includes the dependency to json-c.  
This is activated through **Requires** keyword in pkg-config.
n> ifneq "$(wildcard $(NANOPB_DIR)/generator-bin)" "" # Binary package PROTOC = $(NANOPB_DIR)/generator-bin/protoc PROTOC_OPTS = else # Source only or git checkout PROTOC = protoc ifdef WINDOWS PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb.bat else PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb endif endif # Rule for building .pb.c and .pb.h %.pb.c %.pb.h: %.proto $(wildcard %.options) $(PROTOC) $(PROTOC_OPTS) --nanopb_out=. $<