- Olive oil for sautéing and frying
- 2 medium leeks, roots and dark green leaves cut off, white and light green parts thinly sliced, washed well, and patted dry
- 3 garlic cloves, finely chopped
- Kosher salt and freshly ground black pepper
- About 5 tablespoons all-purpose flour
- 1 medium eggplant, peeled and cut into 1/8- to ¼-inch-thick slices, salted, if necessary (see Note)
- 2 to 3 medium tomatoes, stemmed, cored, and thinly sliced
- 1 medium yellow squash, thinly sliced on the diagonal
- 1 medium zucchini, thinly sliced on the diagonal
- 1 teaspoon chopped fresh thyme
- ½ teaspoon chopped fresh marjoram
- ¼ cup dry white wine
- 2 tablespoons grated pecorino cheese, preferably Pecorino-Romano
- Heat about 2 tablespoons olive oil in a large sauté pan over medium-high heat. Add the leeks and garlic and cook, stirring, until the leeks are tender, about 7 minutes. Season with salt and pepper and spread them on the bottom of a 1½-quart gratin dish.
- Heat the oven to 375°F. Put the flour on a plate. Heat 2 more tablespoons olive oil in the same pan over medium-high heat. Lightly coat a slice of eggplant with flour on both sides, shaking off the excess, and add it to the pan. Do the same with just enough slices of eggplant so as not to crowd the pan. Brown the eggplant slices—in batches and adding more olive oil as needed—on both sides and drain on paper towels.
- Layer the tomatoes, squash, zucchini, and eggplant into the gratin dish on top of the leek mixture. Sprinkle the thyme, marjoram, and white wine over the vegetables. Season with salt and pepper and bake until the vegetables are tender and much of their released juices have evaporated and become more concentrated, about 40 minutes. Sprinkle with the pecornio cheese and let rest at least 5 minutes before serving.