The condensation of 3-ethoxy-4-nitroaniline (I) with 2-(ethoxymethylene)cyanacetic acid ethyl ester (II) in refluxing toluene gives the adduct (III), which is further cyclized in Dowtherm at 258 C to yield 7-ethoxy-6-nitro-4-oxo-1,4-dihydroquinoline-3-carbonitrile (IV). The reaction of (IV) with refluxing POCl3 affords the 4-chloroquinoline (V), which is condensed with 3-chloro-4-fluoroaniline (VI) in refluxing isopropanol to provide the secondary amine (VII). The reduction of the nitro group of (VII) with Fe and NH4Cl in refluxing methanol/water gives the corresponding amino derivative (VIII), which is condensed with the acid chloride (IX) by means of t-BuOCOCl and NMM in THF to yield the amide (X). Finally, this compound is treated with dimethylamine in THF to afford the target quinoline-3-carbonitrile.