Coder Social home page Coder Social logo

Comments (1)

davepruitt avatar davepruitt commented on August 29, 2024

I had a similar issue several months ago. They didn't really make their makefile very Windows-friendly. There are some key differences in the Windows versions of mkdir and echo that are causing these errors to occur.

(1) mkdir in windows doesn't use the "-p" option, and also it wants all slashes to be "\" rather than "/" like in Linux.
(2) echo doesn't seem like it wants to escape double-quotes.

Here is what I have done to fix the issues:

(1) In order to make the BUILD_PATH variable more Windows friendly, I decided to create a 2nd variable in my makefile called BUILD_PATH_WINDOWS.

In the original makefile, you should see a line that looks like this (roughly around line 48 or so?):

BUILD_PATH=build/$(BOARD)

I changed it to read like this:

BUILD_PATH=build/$(BOARD)
BUILD_PATH_WINDOWS=build\$(BOARD)

Now that you have created a BUILD_PATH_WINDOWS variable, find the line in the makefile that is dirs: It should be around line 156 or so. It reads like this:

dirs:
	@echo "Building $(BOARD)"
	-@mkdir -p $(BUILD_PATH)

To make it work nicely on Windows, I changed it to read like this:

dirs:
	@echo "Building $(BOARD)"
	-@mkdir $(BUILD_PATH_WINDOWS)

Finally, you will want to change the commands sitting around line 169 of the makefile, which originally read like this:

$(BUILD_PATH)/uf2_version.h: Makefile
	echo "#define UF2_VERSION_BASE \"$(UF2_VERSION_BASE)\""> $@

For me, I changed them to read like this:

$(BUILD_PATH)/uf2_version.h: Makefile
	echo #define UF2_VERSION_BASE "$(UF2_VERSION_BASE)"> $@

This is because of how the "echo" command behaves in Windows compared to Unix.

After making these changes you should have a working makefile.

There is one possible other change you may need to make. On lines 177 and 187 of the makefile, they run some Python scripts. This means you need Python 3 installed (which they don't make clear in the "Requirements" section of the "Readme" for this repository. In the makefile, they specifically use the command "python3". This may be an issue depending on how you've installed Python.

For me, my installation of Python is through Miniconda, and when it installed Python on my computer, it just called it "python.exe" rather than "python3.exe". So I had to change the makefile to use the python command rather than the python3 command, since there is not uniformity in how Python installations name the main Python executable. Make sure that your Python executable is in your Windows path so that the makefile can find it.

from uf2-samdx1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.