update README

This commit is contained in:
Lephenixnoir 2021-01-28 22:52:11 +01:00
parent 6b5685a35e
commit 8c34abe3ca
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -8,7 +8,9 @@ libprof's measurements are accurate down to the microsecond-level thanks to
precise hardware timers, so it can also be used to time even small portions of
code.
## Installing with GiteaPC
## Installing and using libprof in a program
**Installing with GiteaPC**
libprof can be built and installed with [GiteaPC](https://gitea.planet-casio.com/Lephenixnoir/GiteaPC), an automation tool for the fxSDK.
@ -16,9 +18,7 @@ libprof can be built and installed with [GiteaPC](https://gitea.planet-casio.com
% giteapc install Lephenixnoir/libprof
```
Link with `-lprof-fx` on fx-9860G and `-lprof-cg` on fx-CG 50.
## Building and installing manually
**Installing manually**
libprof should be built with the [fxSDK](/Lephenixnoir/fxsdk), which provides
compiler settings and library interfaces to build on the calculator.
@ -31,6 +31,24 @@ with a suitable toolchain file while exposing CMake modules for the calculator.
% fxsdk build-cg install
```
**Using in a CMake-based add-in**
Find the `LibProf` package, which has a `LibProf` target. Versions are numbered like gint, so aim for your version of gint.
```cmake
find_package(LibProf 2.1 REQUIRED)
target_link_libraries(<target_name> LibProf::LibProf)
```
**Using in a Makefile-based add-in**
Link with `-lprof-fx` on fx-9860G and `-lprof-cg` on fx-CG 50. In `project.cfg`:
```makefile
LIBS_FX := -lprof-fx
LIBS_CG := -lprof-cg
```
## Basic use
To access the library, include the `<libprof.h>` header file and call