To answer your question, there are too many to count. Also, remember that there is music about war in every possible musical genre. Let's look at a few:
1)20th Century Symphonies or orchestral music.
Dmitri Shostakovich wrote his Fourth to Ninth Symphonies as war symphonies. Interestingly, Stalin appropriated these symphonies as propaganda music for his regime, but Shostakovich was more interested in giving voice to the millions who died under the brutal Stalinist rule. All six symphonies were written in the early 1940s. Read about the symphonies here.
Elsewhere, Benjamin Britten's War Requiem spoke of devastation and the dehumanizing influence of war. The Requiem was written to commemorate four of Britten's friends who were killed during World War One. It was first performed at the reconstructed Coventry Cathedral in 1962.
Source: NPR on Benjamin Britten's War Requiem.
The War Requiem Musical Analysis.
2)Music about World Wars One and Two.
Below are some examples of 20th century music about the world wars:
1)Tipperary Guards, Piano Solo by E.T. Paull, 1917.
2)Don't Take My Darling Boy Away, March by Albert von Tilzer, 1915.
3)Liberty Bell: It's Time To Ring Again, Song by Halsey K. Mohr, 1917
4)America, Here's My Boy, Marching Song by Arthur Lange, 1917
5)Long Boy, Song by Barclay Walker, 1917
Read about the ideas and historical implications behind each piece of music here.
Music from World War Two included many popular, contemporary pieces such as Remember Pearl Harbor, Goodbye Mama, I'm Off to Yokohama, There's a Star-Spangled Banner Waving Somewhere, Twenty-one Dollars a Day, Once a Month, and Ma, I Miss Your Apple Pie. Additionally, the military had their own patriotic songs such as The Marine's Hymn and Anchors Aweigh.
Read about more about American popular music from World War Two here.
3)Contemporary 20th Century Music about modern war.
Here is a list of popular music about modern war:
1)One by Metallica (1988).
2)I-Feel-Like-I'm-Fixin-To-Die by Country Joe and the Fish (1967)
3)When the Tigers Broke Free by Pink Floyd (1982)
4)Run To The Hills by Iron Maiden (1982)
5)Masters of War by Bob Dylan (1963).
More examples of modern war music here.
The above is certainly not an exhaustive list, but should certainly give you an idea of the vast number of musical compositions out there about war.