Skip to content

While running make command getting error #1

@RamyaThirumalaisamy

Description

@RamyaThirumalaisamy

Hi pyjama team,
Hi @therustyengineer

I am new to Makefiles and just get started with your tutorials.

While running make command, I am getting message like this. Any Idea why I am getting this message? Your help is much appreciated!!
image

I did some analysis on google and came up with some modifications. Then it started working fine. But still have some doubts on this.

Note : I am using Windows machine

  1. SOURCES = $(shell find $(SRCDIR) -type f -name '*.c') this bit of line is not working in my case. (Getting error while using this line as mentioned above) . I have changed this to SOURCES = $(wildcard src/*/*.c) $(wildcard src/*.c) and it started working fine. Any idea why $(shell find) is not working in my case?

  2. The second modification in my code is while making directories for placing object files. Means @mkdir -p $(@D) this line of code giving error message like below.
    image

As a fix for above error ChatGpt suggest me to put this line of code @if not exist $(subst /,\,$(@D)) mkdir $(subst /,\,$(@D)). The reason for this is, in windows system, it will look for backward slash in file path's instead of forward slash.

  1. The last modification also seems similiar as the above one. It was in clean command. Instead of this rm -rf $(BUILDDIR) , I changed to @if exist $(subst /,\,$(BUILDDIR)) rmdir /s/q $(subst /,\,$(BUILDDIR)). Otherwise I got error message like this.
    image

My doubt is, Is the root cause for the errors are, whether windows require backward slash in it's file system or something else?

If that is true do we have any other commands to use here instead of using $(subst /,\,$(VARIABLE)) everytime?

Also If I don't use @if not exist $(subst /,\,$(@D)) in 2'nd case, I got error messages like below. Is there any other commands instead of using @if not exist
image

If I use -p with mkdir I got error like this. Here I don't know why -p is not working properly? Any thought about this?
image

Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions