In this way, the "way of life" that each of our ancestral groups had, developed from simple gender specialization, to gender roles, to more complex roles, and finally to moral rules.
Initially, behavior within a group was undifferentiated; groups of males mixed with females formed simply because there is "safety in numbers". Then males and females specialized, both genetically (physiologically) and memetically (behavior). Then this gender specialization became codified as a way of life consisting of gender roles. Then the way of life developed so that it was defined by more complex gender roles dictating behavior according to age, social ranking, etc.. At several successive evolutionary moments within this development, moral thinking, then moral enforcement, and then moral rules emerged.