We have probably all been there. I believe the practice is called "copy and paste programming" nowadays. I have certainly written Makefiles by this method. I have tried to learn more about the subject by reading the GNU make manual but it's hard going!

I'd say it's certainly a subject for a series of HPR shows.