mid-15c., "solely, only, and nothing more," from mere (adj.) + -ly (2).
Entries linking to merely
mere adj.
late 14c., of a voice, "pure, clear;" mid-15c., of abstract things, "absolute, sheer;" from Old French mier "pure" (of gold), "entire, total, complete," and directly from Latin merus "unmixed" (of wine), "pure; bare, naked;" figuratively "true, real, genuine," according to some sources probably originally "clear, bright," from PIE *mer- "to gleam, glimmer, sparkle" (source also of Old English amerian "to purify," Old Irish emer "not clear," Sanskrit maricih "ray, beam," Greek marmarein "to gleam, glimmer"). But de Vaan writes "there is no compelling reason to derive 'pure' from 'shining,'" and compares Hittite marri "just so, gratuitously," and suggests the source is a PIE *merH-o- "remaining, pure."
The English sense of "nothing less than, in the fullest sense absolute" (mid-15c., surviving now only in vestiges such as mere folly) existed for centuries alongside the apparently opposite sense of "nothing more than" (1580s, as in a mere dream).
-ly 2
common adverbial suffix, forming from adjectives adverbs signifying "in a manner denoted by" the adjective, Middle English, from Old English -lice, from Proto-Germanic *-liko- (cognates: Old Frisian -like, Old Saxon -liko, Dutch -lijk, Old High German -licho, German -lich, Old Norse -liga, Gothic -leiko); see -ly (1). Cognate with lich, and identical with like (adj.).
Weekley notes as "curious" that Germanic uses a word essentially meaning "body" for the adverbial formation, while Romanic uses one meaning "mind" (as in French constamment from Latin constanti mente). The modern English form emerged in late Middle English, probably from influence of Old Norse -liga.