A makefile for your Eagle projects

Just want to hang out with other Makers and chat about stuff? This is the place to do it.
Post Reply
LukeW
Posts: 91
Joined: Tue Nov 01, 2011 10:14 am

A makefile for your Eagle projects

Post by LukeW » Mon Apr 09, 2012 7:03 pm

Here's a little project I've been working on over Easter, because I was a little bored, and I'm lazy and often get sick of generating and re-generating Gerber CAM files from my Eagle PCB layouts and generating preview images using gerbv.

So I decided to write some code to automate the process.

https://github.com/lukeweston/eagle-makefile

This still contains a few minor bugs and things that need to be tweaked a little bit to make it more user friendly and more robust so it doesn't break. But it's starting to get into a usable form.

Usage: The makefile is invoked in the directory containing the project.brd and project.sch pair of eagle files.

The makefile is edited with the appropriate PROJECT_NAME variable. (Need to improve this so it's more user friendly, possibly by checking the directory name.)

Prerequisites: git, eagle and gerbv installed. Eagle must be in the path so it can be executed from shell.

You'll need a GitHub account - and you'll need to edit the makefile with your username and API key.

At the moment this creates an open-source GitHub repository - if you desire a private GitHub repo you can probably modify the API call to do this.

What it does:

- Generates Gerber files for PCB fabrication.
- Generates a preview rendering of the PCB as a PNG image, using gerbv.
- Generates a template README.markdown file containing a link to the image in the GitHub repo, and the project name, if none exists already.
- Checks everything into a git repository, creating a new repository if it doesn't already exist.
- Builds a GitHub repository if it doesn't already exist.
- Pushes the local git repository to GitHub.

So, just run make, and your Eagle PCB layout is converted into standard Gerber files, with a image rendering generated, committed into a local git repository for version control and backup, and it is (by default) pushed up onto an open-source GitHub repository so it can be shared with the world, and it all happens quickly and easily without any effort required at all. Neat, huh?

Note that if you have Windows I've got no idea what you'd have to do in order to set up and use make successfully... this is more aimed at the Linux and OSX users out there I suppose :)

Comments and suggestions are welcome :)

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: A makefile for your Eagle projects

Post by jonoxer » Tue Apr 10, 2012 12:51 pm

Luke, that's legendary! Every time I manually run through that process I curse the pain, and it never occurred to me that it would be possible to script Eagle. Brilliant.
--
Jon

LukeW
Posts: 91
Joined: Tue Nov 01, 2011 10:14 am

Re: A makefile for your Eagle projects

Post by LukeW » Tue Apr 10, 2012 7:12 pm

Thanks, Jon.

It's still not perfectly workable and user friendly and stable as I would like, and it needs some more finishing. And unix scripting like this is not something I have much experience with.

If anyone would like to try testing, or making any improvements, or making any suggestions or comments that would be great :)

cleveroad
Posts: 1
Joined: Tue Nov 14, 2017 3:52 pm
Contact:

Re: A makefile for your Eagle projects

Post by cleveroad » Tue Nov 14, 2017 4:06 pm

If you are interested in open source projects for Android take a look at this list of top android libraries

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest