Comments (7)
I'd put it in Makefile.example
of esp82xx as well as in the top-level projects' main Makefiles. So someone creating a new project doesn't forget it as easily.
I'm thinking of something like this:
ifndef TARGET
# Fetch submodule if the user forgot to clone with `--recursive`
GETSUBMODS = all burn burnweb netweb netburn clean cleanall purge
.PHONY : $(GETSUBMODS)
$(GETSUBMODS) :
$(warning Submodule esp82xx was not fetched. Trying it now.)
git submodule update --init --recursive
$(info Re-unning make...)
make $@ $(MFLAGS) $(MAKEOVERRIDES)
endif
It gets run, when TARGET
is not defined, a.k.a. including the esp82xx/main.mf
fails. Make usually quits, when it can't include a file, so the lines:
include esp82xx/common.mf
include esp82xx/main.mf
needs to have a minus prepended
-include esp82xx/common.mf
-include esp82xx/main.mf
I will test that right away and make a pull request. By the way, don't know if git supports that, but can you give me access to the esp82xx
repo and maybe colorchord and the others. It's getting annoying to fork and request a pull all the time. If you feel uncomfortable with that though, I understand.
Edit:
I think this can be closed now. Made the pull request in #11.
from esp82xx.
So, I was jump-happy and committed my small change in the projects now, but after reading this, I am having second thoughts. Leaving this issue open and will look into this later today to swap it around to your way.
from esp82xx.
Well, your's would only update an already pulled submodule. Since it's in the submodule, we can't use it in the top level-project, when the user forgot to git clone --recursive
. Should be in both, the Makefile.example
of the submodule and the Makefile
of the top-level.
from esp82xx.
So... Why not do it like this:
-include esp82xx/common.mf
-include esp82xx/main.mf
ifndef TARGET
$(info Modules were not checked out... use git close --recursive in the future. Pulling now.)
$(shell git submodule update --init --recursive)
endif
EDIT: I'm just trying to get away from explicitly calling out targets.
from esp82xx.
I agree, it's ugly. I tried something similar to your code first. Make complained and refused to execute. Forgot why exactly, something like "recipe commences before first target". Maybe at least one rule has to be present or something, so this could work:
-include esp82xx/common.mf
-include esp82xx/main.mf
ifndef TARGET
$(info Modules were not checked out... use git clone --recursive in the future. Pulling now.)
$(shell git submodule update --init --recursive)
endif
.PHONY : empty_rule
empty_rule :
@true
Still, even if this worked, if someone was trying make burn
or any of the other targets, I think make would fail with an "No rule to make target 'burn'" error and worse, not pull the submodules. That would be rather cryptic behavior.
Maybe a match-all pattern rule, i.e. "%" instead of the empty_rule
:
$(shell git submodule update --init --recursive)
endif
% :
$(warning This is the empty rule. Something went wrong.)
@true
But not sure if it would overwrite the included Makefiles still, even when they are pulled and included. But I vaguely remember that specific rules overwrite pattern rules. This could actually work...
from esp82xx.
I don't know what version of Make you're using... I just tried 'make burn' with mine, and it did pull a new copy.
Modules were not checked out... use git close --recursive in the future.
Pulling now.
Cloning into 'embedded8266/esp82xx'...
remote: Counting objects: 119, done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 119 (delta 51), reused 97 (delta 30), pack-reused 0
Receiving objects: 100% (119/119), 95.24 KiB | 0 bytes/s, done.
Resolving deltas: 100% (51/51), done.
Checking connectivity... done.
Makefile:8: *** multiple target patterns. Stop.
I don't think it's necessary to define additional rules?
ifndef TARGET
$(info Modules were not checked out... use git close --recursive in the future.)
$(info Pulling now.)
$(shell git submodule update --init --recursive)
endif
Wow, I can't believe we're beating this "nice to have" so hard :(
from esp82xx.
Let's just call this discussion closed. Everything is fine now.
from esp82xx.
Related Issues (20)
- Not saving wifi credentials HOT 78
- Cannot upgrade via WEB [SOLVED, WITH PATCH] HOT 8
- More on issue #60
- Automatically getting esp_nonos_sdk? HOT 3
- Problem with Scan For Wifi HOT 2
- netburn failing HOT 12
- Feature request/question HOT 6
- Profiling of ESP8266 based code HOT 4
- Add make feature to reset via USB (nodeMCU configuration)
- Failed to detect MPU9250 using I2C HOT 2
- Try upgrading to RTOS SDK
- netburn doesn't work with esp8285 HOT 1
- mfsmaker / windows HOT 5
- esp_nonos_skd @ 80fbd83 missing HOT 4
- Undefined reference to `os_printf` HOT 6
- documentation HOT 1
- Investigate possible use of mask ROM for malloc/free
- [ webgui flashing ] HOT 6
- Error compiling projects HOT 5
- issues with instructions and python-serial HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp82xx.