Debugging `make: 'build' is up to date.`

TL;DR - Rename your directory build something else

Failure

Makefile

build:
    docker build . -t my-basic-app

Look. I have the most basic app, Dockerfile and Makefile. Why can't it just run make build command properly as I defined in Makefile?

shyamajp@ubuntu:~/Projects/my-basic-app$ make build
make: 'build' is up to date.

Debug

Let's get rid of this stupid error. At the root level, you must have a directory named build. That's why you see this unexpected behavior.

In my case, I can change outDir name from build to dist to avoid this specific conflict.
tsconfig.json

{
    "outDir": "dist"
}

Conclusion

Do not name your directory same as Makefile target. Be careful with names like build and test, which are often used for both Makefile targets and directory names.

I know this is a noob question but I've done it a few times already and I thought I might as well document it somewhere for myself. I hope this helps other newbie folks like me.

Feel free to reach out if you have any questions or suggestions to make this article better. Thank you for reading. Happy Coding!

27