diff options
Diffstat (limited to 'example/libfib')
| -rw-r--r-- | example/libfib/Makefile | 12 | ||||
| -rw-r--r-- | example/libfib/fib.c | 11 | ||||
| -rw-r--r-- | example/libfib/fib.h | 9 | ||||
| -rw-r--r-- | example/libfib/fib.o | bin | 0 -> 640 bytes | |||
| -rw-r--r-- | example/libfib/libfib.a | bin | 0 -> 824 bytes | |||
| -rwxr-xr-x | example/libfib/libfib.so.1.1 | bin | 0 -> 16784 bytes |
6 files changed, 32 insertions, 0 deletions
diff --git a/example/libfib/Makefile b/example/libfib/Makefile new file mode 100644 index 0000000..c610923 --- /dev/null +++ b/example/libfib/Makefile @@ -0,0 +1,12 @@ +LIB = fib +SHLIB_MAJOR = 1 +SHLIB_MINOR = 1 +CFLAGS = -Wall \ + -Werror \ + -Wextra \ + -Wpedantic \ + -std=c17 +SRCS = fib.c + +include ../tools/mcd.lib.mk + diff --git a/example/libfib/fib.c b/example/libfib/fib.c new file mode 100644 index 0000000..707215d --- /dev/null +++ b/example/libfib/fib.c @@ -0,0 +1,11 @@ +#include "fib.h" + +uint64_t fib(const uint64_t n) { + if (n <= 0) { + return 0; + } else if (n == 1) { + return 1; + } + return (fib(n - 1) + fib(n - 2)); +} + diff --git a/example/libfib/fib.h b/example/libfib/fib.h new file mode 100644 index 0000000..66615c5 --- /dev/null +++ b/example/libfib/fib.h @@ -0,0 +1,9 @@ +#ifndef FIB_H_ +#define FIB_H_ + +#include <stdint.h> + +uint64_t fib(uint64_t); + +#endif // FIB_H_ + diff --git a/example/libfib/fib.o b/example/libfib/fib.o Binary files differnew file mode 100644 index 0000000..9380b6f --- /dev/null +++ b/example/libfib/fib.o diff --git a/example/libfib/libfib.a b/example/libfib/libfib.a Binary files differnew file mode 100644 index 0000000..1fe78c4 --- /dev/null +++ b/example/libfib/libfib.a diff --git a/example/libfib/libfib.so.1.1 b/example/libfib/libfib.so.1.1 Binary files differnew file mode 100755 index 0000000..2ed114c --- /dev/null +++ b/example/libfib/libfib.so.1.1 |
