We present a complete automatic synthesis framework for oracle functions—a central part in many quantum algorithms. The proposed framework for resource-constrained oracle synthesis (ROS) is an LUT-based hierarchical method where every step is specifically tailored to address hardware resource constraints. ROS embeds an LUT mapper designed to simplify the successive synthesis steps: costing each LUT according to the resources used by its corresponding quantum circuit. In addition, the framework exploits a SAT-based quantum garbage management technique. These characteristics give ROS the ability to beat the state-of-the-art hierarchical method both in number of qubits and in number of operations. The efficiency of the framework is demonstrated by synthesizing quantum oracles for Grover’s algorithm.