makefile optimization flag, readme changes

This commit is contained in:
2016-09-10 22:19:27 +02:00
parent 3a7ab407c3
commit eae3138658
2 changed files with 8 additions and 7 deletions

View File

@@ -1,8 +1,13 @@
# Library for the GY-521 Breakboard # 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). 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 :)

View File

@@ -1,11 +1,7 @@
VERSION = 1.0
CFLAGS = -Wall -g -D_REENTRANT -DVERSION=\"$(VERSION)\" -O3
LDFLAGS = -lwiringPi -lm
all: lib test all: lib test
lib: libgy521.o 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 test: gy521example.o
cc -o test -L. gy521example.o -lgy521 -lwiringPi cc -o test -L. gy521example.o -lgy521 -lwiringPi