From eae3138658816c047ae42f6e7d1f53ab024e1160 Mon Sep 17 00:00:00 2001 From: structix Date: Sat, 10 Sep 2016 22:19:27 +0200 Subject: [PATCH] makefile optimization flag, readme changes --- README.md | 9 +++++++-- makefile | 6 +----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e1cfc27..ec3a192 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ # Library for the GY-521 Breakboard -## Compiling +## Compiling the library This library depends on the wiringPi library. Make sure to install it first (`sudo apt-get install wiringpi` but often it's preinstalled on raspbian). -To compile just type `make` in the projects root. + +1. Compile the library by typing `make` in the projects root. +2. Copy the `libgy521.so` file to `/usr/lib` and the `libgy521.h` header file to `/usr/include`. +3. In case of an error run `ldconfig` to detect the new library +4. have fun :) + diff --git a/makefile b/makefile index fcbad0a..a147851 100644 --- a/makefile +++ b/makefile @@ -1,11 +1,7 @@ -VERSION = 1.0 -CFLAGS = -Wall -g -D_REENTRANT -DVERSION=\"$(VERSION)\" -O3 -LDFLAGS = -lwiringPi -lm - all: lib test lib: libgy521.o - cc -shared -o libgy521.so libgy521.o -lm -lwiringPi + cc -shared -O3 -o libgy521.so libgy521.o -lm -lwiringPi test: gy521example.o cc -o test -L. gy521example.o -lgy521 -lwiringPi