This paper proposes an algorithm for the synthesis of modular supervisors using extended finite-state machines, i.e., state machines with variables and guards on the transitions. Synthesis is performed by iteratively selecting components from a synchronous composition until a least restrictive controllable solution is obtained. This method is usually faster and produces smaller supervisors than standard monolithic synthesis, while offering the modelling benefits of variables. An example of manufacturing system control illustrates the approach.