new target 'zip_release' (more human-friendly alias for $(BIN_TARGET))
allow overriding PROJECT_NAME (useful if doing CI builds / docker and the mounted directory name is generic)
add new target 'build_dir' which copies stuff going into the release zip into a dir named build/ first (easier to inspect/zip)
for release/zip builds, create a version.txt with the makefile version#'s/date in it
create new variable in Makefile IS_CI_BUILD, set to 0 unless overridden on command line (useful so you can know where a build came from. shows up in version.txt and in version strings in the firmware)
other/cleanup:
web: clean: remove tmp/ dir (previously we just removed the directory contents and not the directory itself)
add to .gitignore: libgcc_stripped.a (happens if building with STRIPPED_LIBGCC)
split out BUILD_DATE var for easier access
cleanup Makefile documentation a bit
lint: fix syntax warnings with single quotes in "if you are on a '66 reconfigure CHIP"
zip command always overwrites the file completely instead of appeding
fix various issues with clean and purge not quite getting everything
I'm not super-familiar with how projects are using BIN_TARGET or any of the other stuff, so if anything here breaks other existing projects, let me know, I can modify. I would think it's all pretty compatible though. I'm also a little weak on my Makefile-fu, so if I'm doing anything silly, let me know.
Unrelated stuff
Figured I'd just throw this over here, in case useful for anyone.
I made the above Makefile changes as part of a docker-based CI buildsystem for esp8266 projects. It seems to be working well so far. If interested, I could try to get this setup better / documented for general use.
So you can do something like this (I have some helper scripts that make this more of a one-liner)
# run the following from any host with docker installed (tested on WSL2, native windows, native linux)
# pull the image (run once)
docker pull ghcr.io/unit-e/esp-open-sdk-docker:cnlohr-use-esp82xx-prebuilt
# build an esp82xx project in the docker container.
cd SomeEsp82xxProject/
# run "make all" with Docker:
# mount the working directory from the host OS (i.e. windows) into the docker container, and run the makefile there.
# (note: this $PWD assumes no spaces in the path). here PWD might be something like C:\projects\SomeEsp82xxProject\
docker run --rm -it -v ${PWD}:/home/build/src ghcr.io/unit-e/esp-open-sdk-docker:cnlohr-use-esp82xx-prebuilt /bin/bash -c "make all"
The big limitation to be aware of is, on WSL2 (which is what Docker Desktop on windows uses behind the scenes), serial port forwarding is broken so you can't just flash using the normal methods from inside the docker container. BUT, it's pretty simple to use pyserial's rfc2177 serial-over-ip server to deal with that:
In the makefile (or override on commandline or user.cfg), you set this:
# set serial port name to forwarding to the windows host over the internal network: (using special address host.docker.internal)
PORT = rfc2217://host.docker.internal:4000?ign_set_control
And on the windows host you do something like this:
# listen on port 4000 and control COM7
./esp_rfc2217_server.exe -v -p 4000 COM7
Then all the "make burn" etc works from inside the docker container. pyserial's "miniterm" supports connect for serial monitor like this:
miniterm rfc2217://your-hostname-here
Separately, there is a different [but totally untested and probably problematic] docker build up here that builds the latest esp-open-sdk and puts it in a docker container. That's at: https://github.com/Unit-e/esp-open-sdk-docker/tree/master
I made a few forks of the various submodules that fix some build issues with the latest build based on pfalcon/esp-open-sdk. It appears to compile correctly and produce working firmware, but, I think esp82xx would be needed to be upgraded and tested to see if everything works there.
Anyway, if anyone here was ever looking to upgrade esp82xx to the latest pfalcon-based esp-open-sdk, that might be a good starting point.
Just wanted to shoutout to @cnlohr who has been a good sport about walking my n00b self through a lot of this for the first time.
main: improve zipfile output steps
other/cleanup:
I'm not super-familiar with how projects are using BIN_TARGET or any of the other stuff, so if anything here breaks other existing projects, let me know, I can modify. I would think it's all pretty compatible though. I'm also a little weak on my Makefile-fu, so if I'm doing anything silly, let me know.
Unrelated stuff
Figured I'd just throw this over here, in case useful for anyone.
I made the above Makefile changes as part of a docker-based CI buildsystem for esp8266 projects. It seems to be working well so far. If interested, I could try to get this setup better / documented for general use.
It's available here in this branch: https://github.com/Unit-e/esp-open-sdk-docker/blob/cnlohr-use-esp82xx-prebuilt/Dockerfile
I'll be updating the instructions soon on that, the docker image is available pre-built on github packages here for use with 'docker pull' https://github.com/Unit-e/esp-open-sdk-docker/pkgs/container/esp-open-sdk-docker
So you can do something like this (I have some helper scripts that make this more of a one-liner)
The big limitation to be aware of is, on WSL2 (which is what Docker Desktop on windows uses behind the scenes), serial port forwarding is broken so you can't just flash using the normal methods from inside the docker container. BUT, it's pretty simple to use pyserial's rfc2177 serial-over-ip server to deal with that:
In the makefile (or override on commandline or user.cfg), you set this:
And on the windows host you do something like this:
Then all the "make burn" etc works from inside the docker container. pyserial's "miniterm" supports connect for serial monitor like this:
I made a few forks of the various submodules that fix some build issues with the latest build based on pfalcon/esp-open-sdk. It appears to compile correctly and produce working firmware, but, I think esp82xx would be needed to be upgraded and tested to see if everything works there.
Anyway, if anyone here was ever looking to upgrade esp82xx to the latest pfalcon-based esp-open-sdk, that might be a good starting point.
Just wanted to shoutout to @cnlohr who has been a good sport about walking my n00b self through a lot of this for the first time.