Skip to content

Commit

Permalink
Merge pull request #13 from SunnyBingoMe/patch-2
Browse files Browse the repository at this point in the history
Update README.md for easier compiling
  • Loading branch information
Krzysztow authored May 2, 2022
2 parents bb81e60 + eecc5dc commit d7af2b2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,32 @@ Both apps are linked with libmodbus library. After repository is pulled do the f
compilation
===========

## option 1 (cmake)

```sh
$ git clone https://github.com/Krzysztow/modbus-utils
$ cd modbus-utils
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake ..
$ make
```

## option 2

#assumes you are in a root of the repository

#go to libmodbus dir and compile it

cd ./libmodbus
./configure
./make

#as a result *.so libraries are in export ./src/.libs/ directory

#get back to the root

cd ..
gcc ./modbus_client/modbus_client.c -I./common -I./libmodbus/src/ -L./libmodbus/src/.libs/ -lmodbus -o mbClient
gcc ./modbus_server/modbus_server.c -I./common -I./libmodbus/src/ -L./libmodbus/src/.libs/ -lmodbus -o mbServer
Expand Down

0 comments on commit d7af2b2

Please sign in to comment.