"tube-shaped food made of dried wheaten paste" [Klein], 1590s, from southern Italian dialectal maccaroni (Italian maccheroni), plural of maccarone, name for a kind of pasty food, possibly from maccare "bruise, batter, crush," of unknown origin, or from late Greek makaria "food made from barley."
Used after c.1764 to mean "fop, dandy" (e.g. "Yankee Doodle") because it was an exotic dish at a time when certain young men who had traveled the continent were affecting French and Italian fashions and accents. There is said to have been a Macaroni Club in Britain, which was the immediate source of the term.
[macaroni, ''an Italian,'' is found by 1845]