How to merge all files that end with .mk in a directory and subdirectories into one file?

Posted on

Problem :

I have many makefiles in a top level directory and its subdirectories. I want to combine them all into one big .mk file, what’s the most efficient way to do that?

Solution :

Something like this?

cat $(find . -type f -name *.mk) >

Example:       # a
d1/    # b
d1/    # c
d1/d2/ # d

Would produce in


Leave a Reply

Your email address will not be published.