How to generate many passwords from one passphrase, so that knowledge of one password does not compromise the others? The limitations are: 


it should be a function.
passphrase is so weak, that if hash of it is known (or big part of hash), then it can be brute forced.


I want to get N passwords from one passphrase. Lets imagine, that N hackers have web sites with login pages, and I want to use my N passwords as passwords for accounts on their web sites. I don't want one hacker to be able to find my password for another hacker's web site. 

First what comes to mind is to divide passphrase to N parts, and use each part as a key. Like 

f("MyWeakPassphrase") = {"My", "Weak", "Passphrase" }


(It satisfies restrictions)

But are there better ways?

update
Most of answers suggest to use kdf with salt + counter or something similar. It is still a hash, and if broken, all other passwords revealed. I thought there might be an algorithm, so that brute forcing passphrase will reveal only part of a passphrase if only one password is known. Like function above, but better.
You can just use a counter along with a key derivation function (https://en.wikipedia.org/wiki/Key_derivation_function) such as a hash, and do something such as:

for(int i = 0; i &lt; numberOfPasswordsToGenerate; i++){
   aNewPassword = hash(MyWeakPassphrase + i);
}


The counter makes sure you get a new password, for each iteration of the loop, and they will never know the hash of the original passphrase without the counter.

Of course this can be brute forced, given a large enough dictionary for a dictionary attack or a good rainbow-table, so use a as well salt to prevent that... Actually, just always use a salt. 

Edit:
To be clear on what I mean, this will make it more akin to this:

for(int i = 0; i &lt; numberOfPasswordsToGenerate; i++){
   aNewPassword = hash(MyWeakPassphrase + i + salt);
}


The salt is just a large enough randomly generated number for each password you store next to the encrypted/hashed password in your database. If you just use a single identical salt for all the passwords, it is called a pepper instead, if I remember correctly. 

Note: If you want to go further on security, you could use an IV (initialization vector) that contains the beginning number of the loop, so that the attacker has no idea which numbers you used, unless he gains knowledge of your IV as well. 

This would look sort of like:

void generatePasswords(int IV) {
   for(int i = IV; i &lt; IV + numberOfPasswordsToGenerate; i++){
      aNewPassword = hash(MyWeakPassphrase + i + salt);
   }
}


I'm bad at writing pseudo-code, sorry! It always get C-like, but yet not quite C.

Hope it helps!

NOTE: Please read Krystian's comment. We all suggest that you make different passwords by adding a counter and salt to it. This prevents precomputed attacks, but if someone learns the salt and counter (which can be expected, these are considered "public" knowledge security-wise), then they can bruteforce your primary password. 
The fundamental problem here is that, you want to map a password to multiple unrelated values. In order to be able to recreate this mapping later on (which I assume you would want to, since you derive the passwords from the same passphrase), you need to make the passphrase different and still unique for each new password you make. We do this by adding a salt and counter. Since you need to store the salt and counter to recreate the mapping, they are considered public and thus anyone can still bruteforce your password, since it is weak.