The Oxford Names Companion, OUP "Scottish Forenames" - Donald Whyte, FGH, FSG
Notes:
English, of uncertain origin, possibly an Anglicized form of the Old Irish name Mael-maedóc, "servant of Maedoc". The modern Welsh form Madog [Old Welsh "fortunate/good"] survives.
Thanks to Donald Whyte who provided much of the initial information for this site.