Skip to content

Commit

Permalink
Makefile added.
Browse files Browse the repository at this point in the history
  • Loading branch information
maziac committed Jul 31, 2020
1 parent 6bea693 commit 9cfd26a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.0.0
- Released.

## 0.6.1
- Typos
- "-v" now quits after printing the version number.
Expand Down
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

default: zip


# Create executables
dezogserialif:
pkg out/main.js -o dezogserialinterface -t node12-linux-x64,node12-macos-x64,node12-win-x64

# Create zip file
zip: dezogserialinterface-macos.zip dezogserialinterface-win.zip dezogserialinterface-linux.zip

dezogserialinterface-macos.zip: dezogserialif
# macos zip
rm -f dezogserialinterface-macos.zip
# Copy node_module and use as new zip file
cp bin/node_modules-macos.zip dezogserialinterface-macos.zip
# Add the program
zip dezogserialinterface-macos.zip dezogserialinterface-macos

dezogserialinterface-win.zip: dezogserialif
# win zip
rm -f dezogserialinterface-win.zip
# Copy node_module and use as new zip file
cp bin/node_modules-win.zip dezogserialinterface-win.zip
# Add the program
zip dezogserialinterface-win.zip dezogserialinterface-win.exe

dezogserialinterface-linux.zip: dezogserialif
# linux zip
rm -f dezogserialinterface-linux.zip
# Copy node_module and use as new zip file
#cp bin/node_modules-linux.zip dezogserialinterface-linux.zip
# Add the program
zip dezogserialinterface-linux.zip dezogserialinterface-linux
29 changes: 20 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Every message that is received from DeZog is forwarded to the ZX Next and, vice
# Installation

Simply download and unzip the [binary](https://github.com/maziac/DeZogSerialInterface/releases) for your operating system to a location of your choice.
It doesn't use any additional file.
It doesn't use any additional file.
To start it use the terminal/console.


Expand All @@ -17,7 +17,7 @@ To start it use the terminal/console.
The dezogserialinterface is a commandline program and offers a few options:

- -socket port: If you need to use another socket port than the default 12000 then you can change it here.
- -serial serial_if: Enter here the name of the serial port.
- -serial serial_if: Enter here the name of the serial port.
- -test: This tests if socket and serial port could be opened and prints a success or error message. Please use this to test if your serial port device can be accessed.
- -testloopback: Sends data to the serial port and receives data. The dezogif.nex on the ZX Next will return the packets. I.e. this is a standalone test to test communication over UART/serial.

Expand Down Expand Up @@ -52,7 +52,7 @@ Serial interface /dev/cu.usbserial-14610 @921600baud Error: [Error: Error: No s
```

Loopback test. The USB/serial device needs to be plugged into a USB port and needs to be connected to the ZX Next (ESP) UART:
```
```
node out/main.js -socket 12000 -serial /dev/cu.usbserial-AQ007PCD -testloopback 2 200
USB-Serial connection opened!
Serial interface '/dev/cu.usbserial-AQ007PCD' @921600 baud.
Expand All @@ -66,7 +66,7 @@ Sucessful. No error.
```

Hints:
- On macos you can attach your USB/serial device and use ```ls /dev/cu*``` to find out it's name. E.g. /dev/cu.usbserial-AQ007PCD
- On macos you can attach your USB/serial device and use ```ls /dev/cu*``` to find out it's name. E.g. /dev/cu.usbserial-AQ007PCD
- On Windows the serial port is probably called e.g. "COM1"


Expand All @@ -78,13 +78,24 @@ Use:
pkg out/main.js -o dezogserialinterface -t node12-linux-x64,node12-macos-x64,node12-win-x64
~~~

Or:

Build the executables for all OSes:
~~~
make dezogserialif
~~~

Build all zip files:
~~~
make zip
~~~


# Deploying

The package built with pkg does not include native modules, i.e. it misses the serialport module.
This need to be deployed separately.
Therefore zip the node_modules/serialport folder and add it to the release.
This is required for macos, linux and windows.
I put it in the bin folder.
The user needs to unzip the node modules zip in the same folder as DeZogSerialInterface.
<!-- Unfortunately I don't have one for linux. -->
Therefore the node_modules/serialport folder is added to the created zip files.
The zip file need to be unzipped and the executable can be started.

Note: Unfortunately I don't have a native serial port bianry for linux. If you are using linux you should build dezogserialinterface by yourself.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dezogserialif",
"version": "0.6.1",
"version": "1.0.0",
"description": "Program to allow DeZog communicating with a ZX Next through a serial interface.",
"main": "./out/main.js",
"scripts": {
Expand Down

0 comments on commit 9cfd26a

Please sign in to comment.