Jeff Tanner Jeff Tanner - 1 month ago 23
Linux Question

Makefile as simlink: not found

Is it possible to have a Makefile referenced by a simlink, and try calling action using make?

I am experiencing that calling make in a directory where Makefile is a simlink, Makefile is not found.

I have a need to reduce replication of Makefiles, and I would prefer using simlinks.

Suggestions?

mko mko
Answer

It should work just fine:

test/
├── Makefile
└── mylink -> Makefile
cd test
make -f mylink
Hello
cat mylink
all:
        @echo "Hello"