All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Firstly, we implore Allaah, The Exalted, to reward your sincere efforts. You should know that offering a charity and dedicating its rewards to a deceased person is prescribed in Islam according to the majority of Muslim scholars. Many scholars, such as Ibn Al-Mubaarak and An-Nawawi, stated that a consensus has been reached in this regard because the following was mentioned in the Sunnah: ‘Aa’ishah said, "A man said to the Prophet, sallallaahu ‘alayhi wa sallam, 'My mother died all of a sudden, and I think if she could have spoken, she would have given charity. Will she be rewarded if I give charity on her behalf?' He, sallallaahu ‘alayhi wa sallam, said: 'Yes.'" [Al-Bukhari and Muslim]
An-Nawawi commented on the hadeeth, saying, “This hadeeth advises that the charity offered on behalf of the deceased benefits him and its reward reaches him according to the scholarly consensus.”
Writing the names of the deceased persons to whom the rewards of this charity are dedicated is not an obligation. What counts in this regard is the intention held by the person offering the charity on their behalf. Mataalib Uli An-Nuha (a Hanbali book) reads, “It is permissible for the Muslim to carry out a good deed with the intention to dedicate its reward or part of it to a Muslim person, dead or alive, and the reward reaches him (the person to whom the reward is dedicated)... The fundamental factor in this regard is the doer's intention and not the words used in dedicating the reward...”
As for writing their names on the donated books, there is no harm in that given the absence of relevant religious evidence stating otherwise.
As for the division of the reward among those to whom the reward is dedicated, the predominant opinion is that the reward is divided among them all. Kashshaaf Al-Qinaa’ reads, “It is permissible for the person to perform a good deed and dedicate all or part of its reward, like one half, one-third, or one-fourth, to a Muslim, whether dead or alive. Both of them benefit from that and receive the reward.”
Some scholars even held that dedicating the reward of a good deed to another person does not decrease the reward of the doer in the least. Haashiyat Ibn ʻAabideen reads, “Al-Fataawa At-Tataarkhaaniyyah citing Al-Muheet reads: ‘It is recommended for the person offering a charity to dedicate its reward to all the believers because they all shall receive the reward and this does not decrease his reward in the least as well...’”
Hence, based on that scholarly view, both the doer and the deceased persons to whom the reward is dedicated may receive the reward in full.
Allaah Knows best.