nodbus-plus 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.readthedocs.yaml +34 -34
- package/LICENSE.md +21 -21
- package/README.md +167 -163
- package/docs/Makefile +20 -20
- package/docs/client/channel.rst +204 -209
- package/docs/client/nodbus_master_serial.rst +521 -559
- package/docs/client/nodbus_master_tcp.rst +529 -573
- package/docs/conf.py +41 -41
- package/docs/index.rst +30 -30
- package/docs/make.bat +35 -35
- package/docs/protocol/modbus_master.rst +355 -276
- package/docs/protocol/modbus_master_serial.rst +294 -290
- package/docs/protocol/modbus_master_tcp.rst +268 -296
- package/docs/protocol/modbus_server.rst +488 -469
- package/docs/protocol/modbus_server_serial.rst +392 -543
- package/docs/protocol/modbus_server_tcp.rst +197 -365
- package/docs/requirements.txt +3 -3
- package/docs/server/net_server.rst +226 -242
- package/docs/server/nodbus_serial_server.rst +339 -652
- package/docs/server/nodbus_tcp_server.rst +307 -505
- package/docs/starting.rst +220 -192
- package/package.json +46 -39
- package/samples/mb_serial_server.js +102 -77
- package/samples/mb_tcp_client.js +158 -114
- package/samples/mb_tcp_server.js +114 -58
- package/src/client/net/serialchannel.js +203 -194
- package/src/client/net/tcpchannel.js +228 -233
- package/src/client/net/udpchannel.js +227 -242
- package/src/client/nodbus_serial_client.js +575 -577
- package/src/client/nodbus_tcp_client.js +554 -542
- package/src/nodbus-plus.js +146 -157
- package/src/nodbus-plus.mjs +18 -0
- package/src/protocol/modbus_master.js +405 -298
- package/src/protocol/modbus_master_serial.js +260 -246
- package/src/protocol/modbus_master_tcp.js +253 -219
- package/src/protocol/modbus_server.js +1126 -936
- package/src/protocol/modbus_server_serial.js +431 -368
- package/src/protocol/modbus_server_tcp.js +178 -129
- package/src/protocol/utils.js +371 -296
- package/src/server/net/serialserver.js +188 -183
- package/src/server/net/tcpserver.js +291 -290
- package/src/server/net/udpserver.js +243 -241
- package/src/server/nodbus_serial_server.js +234 -238
- package/src/server/nodbus_tcp_server.js +250 -249
- package/test/client_net_serialchannel.test.js +137 -0
- package/test/client_net_tcpchannel.test.js +256 -0
- package/test/client_net_udpchannel.test.js +240 -0
- package/test/client_nodbus_serial_client.test.js +543 -0
- package/test/client_nodbus_tcp_client.test.js +280 -0
- package/test/nodbus_plus_common.test.js +111 -0
- package/test/nodbus_plus_ecma.test.mjs +115 -0
- package/test/protocol_modbus_master.test.js +325 -0
- package/test/protocol_modbus_master_serial.test.js +244 -0
- package/test/protocol_modbus_master_tcp.test.js +268 -0
- package/test/protocol_modbus_server.test.js +380 -0
- package/test/protocol_modbus_server_serial.test.js +303 -0
- package/test/protocol_modbus_server_tcp.test.js +173 -0
- package/test/protocol_utils.test.js +94 -0
- package/test/server_net_serialserver.test.js +202 -0
- package/test/server_net_tcpserver.test.js +223 -0
- package/test/server_net_udpserver.test.js +142 -0
- package/test/server_nodbus_serial_server.test.js +186 -0
- package/test/server_nodbus_tcp_server.test.js +170 -0
- package/test/modbus_master.test.js +0 -279
- package/test/modbus_master_serial.test.js +0 -124
- package/test/modbus_master_tcp.test.js +0 -178
- package/test/modbus_server.test.js +0 -506
- package/test/modbus_server_serial.test.js +0 -328
- package/test/modbus_server_tcp.test.js +0 -91
- package/test/nodbus_client_serial.test.js +0 -307
- package/test/nodbus_client_tcp.test.js +0 -334
- package/test/nodbus_server_serial.test.js +0 -255
- package/test/nodbus_server_tcp.test.js +0 -216
package/.readthedocs.yaml
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# .readthedocs.yaml
|
|
2
|
-
# Read the Docs configuration file
|
|
3
|
-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
-
|
|
5
|
-
# Required
|
|
6
|
-
version: 2
|
|
7
|
-
|
|
8
|
-
# Set the OS, Python version and other tools you might need
|
|
9
|
-
build:
|
|
10
|
-
os: ubuntu-22.04
|
|
11
|
-
tools:
|
|
12
|
-
python: "3.11"
|
|
13
|
-
# You can also specify other tool versions:
|
|
14
|
-
# nodejs: "19"
|
|
15
|
-
# rust: "1.64"
|
|
16
|
-
# golang: "1.19"
|
|
17
|
-
|
|
18
|
-
# Build documentation in the "docs/" directory with Sphinx
|
|
19
|
-
sphinx:
|
|
20
|
-
configuration: docs/conf.py
|
|
21
|
-
|
|
22
|
-
# Optionally build your docs in additional formats such as PDF and ePub
|
|
23
|
-
# formats:
|
|
24
|
-
# - pdf
|
|
25
|
-
# - epub
|
|
26
|
-
|
|
27
|
-
# Optional but recommended, declare the Python requirements required
|
|
28
|
-
# to build your documentation
|
|
29
|
-
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
30
|
-
|
|
31
|
-
# Optionally declare the Python requirements required to build your docs
|
|
32
|
-
python:
|
|
33
|
-
install:
|
|
34
|
-
- requirements: docs/requirements.txt
|
|
1
|
+
# .readthedocs.yaml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# Set the OS, Python version and other tools you might need
|
|
9
|
+
build:
|
|
10
|
+
os: ubuntu-22.04
|
|
11
|
+
tools:
|
|
12
|
+
python: "3.11"
|
|
13
|
+
# You can also specify other tool versions:
|
|
14
|
+
# nodejs: "19"
|
|
15
|
+
# rust: "1.64"
|
|
16
|
+
# golang: "1.19"
|
|
17
|
+
|
|
18
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
19
|
+
sphinx:
|
|
20
|
+
configuration: docs/conf.py
|
|
21
|
+
|
|
22
|
+
# Optionally build your docs in additional formats such as PDF and ePub
|
|
23
|
+
# formats:
|
|
24
|
+
# - pdf
|
|
25
|
+
# - epub
|
|
26
|
+
|
|
27
|
+
# Optional but recommended, declare the Python requirements required
|
|
28
|
+
# to build your documentation
|
|
29
|
+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
30
|
+
|
|
31
|
+
# Optionally declare the Python requirements required to build your docs
|
|
32
|
+
python:
|
|
33
|
+
install:
|
|
34
|
+
- requirements: docs/requirements.txt
|
|
35
35
|
|
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 Héctor Enrique Socarrás Cabrera
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Héctor Enrique Socarrás Cabrera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,163 +1,167 @@
|
|
|
1
|
-
# Nodbus-Plus
|
|
2
|
-
|
|
3
|
-
A Modbus protocol library for Node.js, written entirely in JavaScript. It supports both Modbus Serial and Modbus TCP.
|
|
4
|
-
|
|
5
|
-
## Introduction
|
|
6
|
-
|
|
7
|
-
Nodbus
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```console
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
###
|
|
18
|
-
|
|
19
|
-
```javascript
|
|
20
|
-
const nodbus = require('nodbus-plus');
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
const cfg = {
|
|
24
|
-
inputs
|
|
25
|
-
coils
|
|
26
|
-
holdingRegisters
|
|
27
|
-
inputRegisters
|
|
28
|
-
port
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
let server = nodbus.createTcpServer('tcp', cfg);
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
###
|
|
83
|
-
|
|
84
|
-
To create a
|
|
85
|
-
|
|
86
|
-
```javascript
|
|
87
|
-
const nodbus = require('nodbus-plus');
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
client
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
//
|
|
121
|
-
channelCfg = {
|
|
122
|
-
ip:'127.0.0.1',
|
|
123
|
-
port:502,
|
|
124
|
-
timeout:250
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
client.addChannel('
|
|
128
|
-
client.connect('
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
##
|
|
162
|
-
|
|
163
|
-
|
|
1
|
+
# Nodbus-Plus
|
|
2
|
+
|
|
3
|
+
A Modbus protocol library for Node.js, written entirely in JavaScript. It supports both Modbus Serial and Modbus TCP.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
Nodbus-Plus is a Modbus protocol stack for Node.js. You can use its API to create your own Modbus client and server, or use its built-in client and server for quick Modbus communication in just minutes.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
npm install nodbus-plus
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
### Creating a Modbus Server
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
const nodbus = require('nodbus-plus');
|
|
21
|
+
|
|
22
|
+
// TCP server configuration (uses default values if not specified)
|
|
23
|
+
const cfg = {
|
|
24
|
+
inputs: 2048, // Number of discrete inputs
|
|
25
|
+
coils: 2048, // Number of coils
|
|
26
|
+
holdingRegisters: 2048, // Number of holding registers
|
|
27
|
+
inputRegisters: 2048, // Number of input registers
|
|
28
|
+
port: 502 // Port on which to listen
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
let server = nodbus.createTcpServer('tcp', cfg);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The first argument specifies the transport layer type. Supported options are `'tcp'`, `'udp4'`, and `'udp6'`.
|
|
35
|
+
To create a serial server instead, use `createSerialServer`:
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
// Serial server configuration
|
|
40
|
+
const cfg = {
|
|
41
|
+
address: 1, // Modbus slave address (1–247)
|
|
42
|
+
transmissionMode: 0, // 0 = RTU, 1 = ASCII
|
|
43
|
+
inputs: 2048, // Number of discrete inputs
|
|
44
|
+
coils: 2048, // Number of coils
|
|
45
|
+
holdingRegisters: 2048, // Number of holding registers
|
|
46
|
+
inputRegisters: 2048, // Number of input registers
|
|
47
|
+
port: 'COM1' // Serial port path (e.g., 'COM1' on Windows, '/dev/ttyUSB0' on Linux)
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
let server = nodbus.createSerialServer('serial', cfg);
|
|
51
|
+
```
|
|
52
|
+
#### Listen for Server Events
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
// Emitted when server starts listening
|
|
56
|
+
server.on('listening', (port) => {
|
|
57
|
+
console.log('Server listening on port:', port);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Emitted when a request is received from a client
|
|
61
|
+
server.on('request', (socket, req) => {
|
|
62
|
+
console.log('Request received:', req);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Emitted before sending a response to client
|
|
66
|
+
server.on('response', (socket, res) => {
|
|
67
|
+
console.log('Response:', res);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Emitted when an error occurs
|
|
71
|
+
server.on('error', (err) => {
|
|
72
|
+
console.error('Error:', err);
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Finally, start the server:
|
|
77
|
+
|
|
78
|
+
```javascript
|
|
79
|
+
server.start();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Creating a Modbus Client
|
|
83
|
+
|
|
84
|
+
To create a Modbus client, use `createTcpClient` or `createSerialClient`:
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
const nodbus = require('nodbus-plus');
|
|
88
|
+
|
|
89
|
+
let client = nodbus.createSerialClient();
|
|
90
|
+
|
|
91
|
+
// Emitted when client establishes connection with the server
|
|
92
|
+
client.on('connection', (id) => {
|
|
93
|
+
console.log('Connection established:', id);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Emitted when an error occurs
|
|
97
|
+
client.on('error', (err) => {
|
|
98
|
+
console.error('Error:', err);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Emitted when a request is sent to server
|
|
102
|
+
client.on('request', (id, req) => {
|
|
103
|
+
console.log('Request sent to device:', id);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Emitted when a response timeout occurs
|
|
107
|
+
client.on('req-timeout', (id, adu) => {
|
|
108
|
+
console.error('Request timeout for device:', id);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Emitted when a response is received
|
|
112
|
+
client.on('response', (id, res) => {
|
|
113
|
+
console.log('Response from device:', id, res);
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Add channels to the client. Each channel represents a connection to a Modbus device:
|
|
118
|
+
|
|
119
|
+
```javascript
|
|
120
|
+
// Channel configuration
|
|
121
|
+
const channelCfg = {
|
|
122
|
+
ip: '127.0.0.1', // Target device IP address
|
|
123
|
+
port: 502, // Target device port
|
|
124
|
+
timeout: 250 // Request timeout in milliseconds
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
client.addChannel('device1', 'tcp1', channelCfg);
|
|
128
|
+
client.connect('device1');
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Once connected, use available Modbus functions to exchange data:
|
|
132
|
+
|
|
133
|
+
```javascript
|
|
134
|
+
// Read 2 coils starting at address 0 from device at Modbus address 1
|
|
135
|
+
client.readCoils('device1', 1, 0, 2);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Documentation
|
|
139
|
+
|
|
140
|
+
For comprehensive API documentation, visit the [official documentation](https://nodbus-plus.readthedocs.io/en/latest/).
|
|
141
|
+
|
|
142
|
+
## Getting Started
|
|
143
|
+
|
|
144
|
+
New to Nodbus-Plus? The [Getting Started Guide](https://nodbus-plus.readthedocs.io/en/latest/starting.html) provides installation instructions and basic usage examples.
|
|
145
|
+
|
|
146
|
+
## Examples
|
|
147
|
+
|
|
148
|
+
See the `./samples` directory for example programs demonstrating library usage.
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## Features
|
|
153
|
+
|
|
154
|
+
- **Full Modbus Protocol Support**: Read/write coils, discrete inputs, holding registers, and input registers.
|
|
155
|
+
- **Modbus Serial (RTU/ASCII)**: Serial communication with RTU and ASCII transmission modes.
|
|
156
|
+
- **Modbus TCP**: TCP/IP network communication with standard Modbus TCP protocol.
|
|
157
|
+
- **Pure JavaScript**: No native dependencies; works on any Node.js environment.
|
|
158
|
+
- **Client & Server**: Create both Modbus clients and servers with the same library.
|
|
159
|
+
- **Event-Driven**: Asynchronous event-based API for responsive applications.
|
|
160
|
+
|
|
161
|
+
## Contributing
|
|
162
|
+
|
|
163
|
+
Contributions are welcome! If you find a bug or have a feature suggestion, please [open an issue](https://github.com/hsocarras/nodbus-plus/issues).
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
MIT License. See `LICENSE.md` for details.
|
package/docs/Makefile
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Minimal makefile for Sphinx documentation
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
# You can set these variables from the command line, and also
|
|
5
|
-
# from the environment for the first two.
|
|
6
|
-
SPHINXOPTS ?=
|
|
7
|
-
SPHINXBUILD ?= sphinx-build
|
|
8
|
-
SOURCEDIR = source
|
|
9
|
-
BUILDDIR = build
|
|
10
|
-
|
|
11
|
-
# Put it first so that "make" without argument is like "make help".
|
|
12
|
-
help:
|
|
13
|
-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
-
|
|
15
|
-
.PHONY: help Makefile
|
|
16
|
-
|
|
17
|
-
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
-
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
-
%: Makefile
|
|
20
|
-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|