Putting aside the fact, that this is just a terrible idea, you can add them as any other file:
git add *.o
git commit -m "Committing compiled files, which is bad"
Of course instead of git add *.o
you can use git add */*.o
or even find -name *.o | while read x; do git add $x; done
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…