Makefile for the Z-Uno

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
jucs
Posts: 35
Joined: 28 Dec 2016 17:56

Makefile for the Z-Uno

Post by jucs »

Hello everyone,

I'd like to use a more serious IDE than the Arduino IDE; thus, I'd like to be able to compile without it. Is there any public Makefile or something for the Z-Uno stuff? Even when enabling debug output, there are still some commands missing on the terminal, so I'm having trouble making my own one...

Thanks!
User avatar
PoltoS
Posts: 7562
Joined: 26 Jan 2011 19:36

Re: Makefile for the Z-Uno

Post by PoltoS »

You can check the package file to see files how Arduino IDE is invoking our compiler. On Linux you can even do strace -e trace=system -f ./arduino to see commands executed ;)

May be you can post your recipe then
jucs
Posts: 35
Joined: 28 Dec 2016 17:56

Re: Makefile for the Z-Uno

Post by jucs »

Ok thank you, I'll try to find it out using strace ;)
jucs
Posts: 35
Joined: 28 Dec 2016 17:56

Re: Makefile for the Z-Uno

Post by jucs »

Hi again,

I more or less got where I wanted to get. I did try to invoke sdcpp / sdcc myself, however it's complicated to follow all the calls. I did find a way to utilize the "compiler" binary that builds a sketch; this way, I've built a (very basic) Makefile and a project template.

The code is here:

https://github.com/jucs/embedded-templa ... no-project

The main project file is project.cpp. Additional files can be added in src/ which is a link into the libraries directory from which cpp file seem to be compiled. Building is done as follws:

Code: Select all

make build
The program can then be transferred using make:

Code: Select all

PORT=ttyACM0 make transfer
Don't forget to add the header file paths in Z-Uno/... in the project configuration of your favorite IDE so the indexer finds them ;-).
p0lyg0n1
Posts: 242
Joined: 04 Aug 2016 07:14

Re: Makefile for the Z-Uno

Post by p0lyg0n1 »

I use Sublime editor for thiss:
Here is my environment(MacOS X, sublime):
1. Build file (.sublime-build):

Code: Select all

 

  "shell": false,
  "working_dir" : "$file_path",
  "selector": "source.c",
  "cmd": ["zme_zunocompiler","build","${file_path}/${file_name}","-r","/Users/alexander/WholeEnvironment/Z-Uno/hardware/zw8051/2.x.x", "-p", "/Users/alexander/Code/ZUno/compilerCXX/sdcc/"],
  "variants":
  [
    {
      "name":"Upload sketch",
      "cmd": ["zme_zunocompiler","prog","${file_path}/${file_name}","-d","/dev/cu.usbmodem621","-p","sec=0","-p","mcmd=0"]
       
    }

  ]
}
You have to change this

Code: Select all

/Users/alexander/WholeEnvironment/Z-Uno/hardware/zw8051/2.x.x
to path to your core-files (you can find them in Arduino15/packages/Z-Uno/tools/zuno_toolchain/00.08.20/Arduino15/hardware) and

Code: Select all

/Users/alexander/Code/ZUno/compilerCXX/sdcc
to sdcc-path (it's located in Arduino15/packages/Z-Uno/tools/zuno_toolchain/00.08.20/zuno_toolchain/sdcc).

2. zme_zunocompiler script(have to be in your PATH):

Code: Select all

#!/bin/sh
 ~/Library/Arduino15/packages/Z-Uno/tools/zuno_toolchain/00.08.20/zuno_toolchain/compiler $@
Post Reply