A general procedure is presented to derive a complete set of force-field parameters for flexible molecules in the crystalline state on a case-by-case basis. The force-field parameters are fitted to the electrostatic potential as well as to accurate energies and forces generated by means of a hybrid method that combines solid-state density functional theory (DFT) calculations with an empirical van der Waals correction. All DFT calculations are carried out with the VASP program. The mathematical structure of the force field, the generation of reference data, the choice of the figure of merit, the optimization algorithm, and the parameter-refinement strategy are discussed in detail. The approach is applied to cyclohexane-1,4-dione, a small flexible ring. The tailor-made force field obtained for cyclohexane-1,4-dione is used to search for low-energy crystal packings in all 230 space groups with one molecule per asymmetric unit, and the most stable crystal structures are reoptimized in a second step with the hybrid method. The experimental crystal structure is found as the most stable predicted crystal structure both with the tailor-made force field and the hybrid method. The same methodology has also been applied successfully to the four compounds of the fourth CCDC blind test on crystal-structure prediction. For the five aforementioned compounds, the root-mean-square deviations between lattice energies calculated with the tailor-made force fields and the hybrid method range from 0.024 to 0.053 kcal/mol per atom around an average value of 0.034 kcal/mol per atom.