In the bowl of a food processor, combine the basil, pine nuts, Parmesan cheese, garlic, salt, pepper and crushed red pepper flakes (if using). Pulse together.
Slowly stream in olive oil while pulsing together.
Add more olive oil as needed to reach your desired consistency.
Keep refrigerated in an air tight container until ready to use. Remaining pesto can be frozen for later use.