takanuva / arduino-makefile Goto Github PK
View Code? Open in Web Editor NEWAn alternative to the Arduino IDE's bulding/uploading, using a gnu-make.
An alternative to the Arduino IDE's bulding/uploading, using a gnu-make.
###################################################################### # Arduino Project's Skeleton # # Written by: Paulo H. "Taka" Torrens <[email protected]> # ###################################################################### 1 - About This is an Arduino makefile, an alternative to the current IDE, which I made in hope to help the Arduino community. It will build your source code and any library you want to use with it. I've also created a quite simple Serial.printf(const char *, ...), it currently only works with %d and %s, but better than nothing. It is in the file ./lib/default/Print.cpp, if you want to see it. You may use this for any porpuse, and edit as you want. This code is released under the GPL license. It is not needed at all, but it would be apreciated if you comment you used my software, or just send me an e-mail with thanks. =D Enjoy, folks. 2 - Directory Structure ###################################################################### # ./ # Project's root directory # # ./Makefile # The project Makefile # # ./scripts # Scripts' directory # # ---------/make.rb # The Makefile generator script # # ---------/size.rb # Size verifier script # # ---------/... # Project's remaining scripts # # ./lib # Libraries' directory # # -----/... # Library "x" directory # # -----/.../... # Library "x" source files (scanned recursively) # # ./src # Project's source directory # # -----/... # Project's source files (scanned recursively) # # ./include # Project's headers directory # # ---------/... # Project's headers (scanned recursively) # ###################################################################### 3 - The Output The output files will be all the libraries *.a files, the binary "project.elf" file, which is converted to "project.hex". This final file is then uploaded by running "make upload". 4 - Makefile The Makefile is automatically generated every time a modification to some directory, to the Makefile and to the generator itself (so it is useless to edit it, as it will be recreated). It is created by scripts/make.rb, and uses scripts/size.rb to check the size of the final program. The generator will create all the libraries and the program itself, scanning the folders recursivelly. Some rules: "make": will generate the final file, "project.hex". It will recreate the Makefile itself if necessary. "make upload": generates the file (if not generated yet) and then uploads it to the Arduino board. It is not necessary to call "make" before it, because it checks if the final file is up to date before doing the upload itself. It will also check the binary size. The default port is /dev/tty0, to change the number you can, e.g., call "make USB=1" to use /dev/tty1 instead. "make clean": deletes all the files created by the project (i.e., all the *.o files, *.a libraries, the "project.elf" and the "project.hex". 5 - Libraries Libraries may be reused in another project. Each directory inside the "lib" directory is considered a different library (e.g., the "default" directory will generate the library default.a, with all the source codes it may find inside lib/default (scanning recursivelly). To create a new lib, e.g., "foo", create a directory foo in the "lib" directory, and populate it with *.c or *.cpp files. The Makefile will be automatically recreated and the library rule will have been made, and a foo.a file will appear (and will be added to the final executable).
Hi!
how add a new library properly ?
is need setup/configure arduino ide path (binary dependency) ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.