Skip to content

Make Into Build Folder #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dominicap opened this issue Nov 26, 2015 · 2 comments
Closed

Make Into Build Folder #395

dominicap opened this issue Nov 26, 2015 · 2 comments

Comments

@dominicap
Copy link

Hello,

I was wondering if it was possible to keep the Makefile and .ino files in the src folder and when make or make upload is executed, it builds it into the build folder instead of the src folder. Is there a flag to do this? I believe it is somewhat similar to #267

This is my Project Structure

├── build
├── docs
├── ext
│   ├── include
│   ├── libs
└── src
    └── blink.ino
    └── Makefile
@sej7278
Copy link
Collaborator

sej7278 commented Nov 27, 2015

have a look at https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md#objdir

this Makefile works for me:

BOARD_TAG = uno
MONITOR_PORT = /dev/ttyUSB0
OBJDIR = ../build
USER_LIB_PATH = ../ext/libs
include /usr/share/arduino/Arduino.mk

with this directory structure:

├── build/
│   ├── core/
│   │   ├── avr-libc/
│   │   ├── CDC.cpp.d
│   │   ├── blah...
│   │   └── WString.cpp.o
│   ├── libcore.a
│   ├── libs/
│   │   └── Servo/
│   ├── obstacle_bot.ino.d
│   ├── obstacle_bot.ino.o
│   ├── src.eep
│   ├── src.elf
│   ├── src.hex
│   ├── src.hex.sizeok
│   └── userlibs/
│       └── DCMotor/
├── docs/
├── ext/
│   └── libs/
│       └── DCMotor/
└── src/
    ├── Makefile
    └── obstacle_bot.ino

just call make upload from within the src/ directory and don't forget build/ is deleted when you make clean

@dominicap
Copy link
Author

Works perfectly, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants