The Vedas, including the Upanishads, Manu Samhita, Puranas and other ancient Vedic texts including the Ramayana and Mahabharat do indeed codify very clearcut moral codes. The Yoga Shastras have the clear Yamas and Niyamas as well. The Manu Samhita details different rights, duties and responsibilities for different castes and orders of life. The Puranas have many teaching stories illustrating such moral and spiritual codes.
All these of course pre-date Christianity by several thousands of years.
I may have been misled by my admittedly shallow understanding of the Mahabharata. It seemed quite like the Iliad in tone and substance.