A compound of formula: or a pharmaceutically acceptable salt thereof, wherein: m is 0, 1, or 2; Z is selected from -OCH 3 and -O(CH 2) n Ar; wherein n is 1, 2, 3, or 4; Ar is selected from phenyl and pyridinyl, wherein each ring is optionally substituted with 1, 2, 3, or 4 substituents independently selected from C 1 -C 4 alkoxy, C 1 -C 4 alkyl, amido, carboxy, cyano, formyl, halo, haloC 1 -C 4 alkyl, haloC 1 -C 4 alkoxy, and nitro; A is selected from -CH 2 O-, -OCH 2 -, -(CH 2) 2 -, -CH=CH-, -C NH-, and -NHC -, wherein each group is drawn with its left side attached to R 2 and its right side attached to the phenyl ring; R 2 is selected from wherein R m and R n are independently selected from hydrogen, C 1 -C 3 alkyl, and halo; Y is selected from hydrogen, C 1 -C 3 alkoxy, C 1 -C 3 alkyl, cyano, and halo; R 5 is a three- to ten-membered monocyclic or bicyclic ring optionally containing one or two heteroatoms independently selected from nitrogen and oxygen and containing zero, one, two, or three double bonds, wherein said ring is optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkoxyC 1 -C 4 alkyl, C 1 -C 4 alkoxycarbonyl, C 1 -C 4 alkyl, di(C 1 -C 4)alkylamino, amino, aminoC 1 -C 4 alkyl, carboxy, carboxyC 1 -C 4 alkyl, C 3 -C 4 cycloalkyl, and phenyl; each R 3 is independently selected from C 1 -C 4 alkyl, cyano, halo, and haloC 1 -C 4 alkyl; R 4 is selected from -CH 2 OH, -CHO and -(CH 2) n NR q R 8; wherein n is 1, 2, 3, or 4; R q is selected from hydrogen and C 1 -C 4 alkyl; R 8 is selected from hydrogen, C 1 -C 4 alkyl, -(CH 2) n N(CH 3) 2, R 9 is selected from hydrogen and C 1 alkyl; each R 9' is independently selected from hydrogen and C 1 -C 3 alkyl; and R 10 is selected from hydrogen and C 1 -C 4 alkyl; or R 8 and R q, together with the nitrogen atom to which they are attached, form a ring which is wherein s is 0, 1, or 2; z is 1, 2, or 3; and each R 14 is independently selected from C 1 -C 4 alkoxycarbonyl, C 1 -C 6 alkyl, carboxy, halo, hydroxy, and hydroxyC 1 -C 4 alkyl. m is 0, 1, or 2; Z is selected from -OCH 3 and -O(CH 2) n Ar; wherein n is 1, 2, 3, or 4; Ar is selected from phenyl and pyridinyl, wherein each ring is optionally substituted with 1, 2, 3, or 4 substituents independently selected from C 1 -C 4 alkoxy, C 1 -C 4 alkyl, amido, carboxy, cyano, formyl, halo, haloC 1 -C 4 alkyl, haloC 1 -C 4 alkoxy, and nitro; n is 1, 2, 3, or 4; Ar is selected from phenyl and pyridinyl, wherein each ring is optionally substituted with 1, 2, 3, or 4 substituents independently selected from C 1 -C 4 alkoxy, C 1 -C 4 alkyl, amido, carboxy, cyano, formyl, halo, haloC 1 -C 4 alkyl, haloC 1 -C 4 alkoxy, and nitro; A is selected from -CH 2 O-, -OCH 2 -, -(CH 2) 2 -, -CH=CH-, -C NH-, and -NHC -, wherein each group is drawn with its left side attached to R 2 and its right side attached to the phenyl ring; R 2 is selected from wherein R m and R n are independently selected from hydrogen, C 1 -C 3 alkyl, and halo; Y is selected from hydrogen, C 1 -C 3 alkoxy, C 1 -C 3 alkyl, cyano, and halo; R 5 is a three- to ten-membered monocyclic or bicyclic ring optionally containing one or two heteroatoms independently selected from nitrogen and oxygen and containing zero, one, two, or three double bonds, wherein said ring is optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkoxyC 1 -C 4 alkyl, C 1 -C 4 alkoxycarbonyl, C 1 -C 4 alkyl, di(C 1 -C 4)alkylamino, amino, aminoC 1 -C 4 alkyl, carboxy, carboxyC 1 -C 4 alkyl, C 3 -C 4 cycloalkyl, and phenyl; R m and R n are independently selected from hydrogen, C 1 -C 3 alkyl, and halo; Y is selected from hydrogen, C 1 -C 3 alkoxy, C 1 -C 3 alkyl, cyano, and halo; R 5 is a three- to ten-membered monocyclic or bicyclic ring optionally containing one or two heteroatoms independently selected from nitrogen and oxygen and containing zero, one, two, or three double bonds, wherein said ring is optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkoxyC 1 -C 4 alkyl, C 1 -C 4 alkoxycarbonyl, C 1 -C 4 alkyl, di(C 1 -C 4)alkylamino, amino, aminoC 1 -C 4 alkyl, carboxy, carboxyC 1 -C 4 alkyl, C 3 -C 4 cycloalkyl, and phenyl; each R 3 is independently selected from C 1 -C 4 alkyl, cyano, halo, and haloC 1 -C 4 alkyl; R 4 is selected from -CH 2 OH, -CHO and -(CH 2) n NR q R 8; wherein n is 1, 2, 3, or 4; R q is selected from hydrogen and C 1 -C 4 alkyl; R 8 is selected from hydrogen, C 1 -C 4 alkyl, -(CH 2) n N(CH 3) 2, R 9 is selected from hydrogen and C 1 alkyl; each R 9' is independently selected from hydrogen and C 1 -C 3 alkyl; and R 10 is selected from hydrogen and C 1 -C 4 alkyl; or R 8 and R q, together with the nitrogen atom to which they are attached, form a ring which is wherein s is 0, 1, or 2; z is 1, 2, or 3; and each R 14 is independently selected from C 1 -C 4 alkoxycarbonyl, C 1 -C 6 alkyl, carboxy, halo, hydroxy, and hydroxyC 1 -C 4 alkyl. n is 1, 2, 3, or 4; R q is selected from hydrogen and C 1 -C 4 alkyl; R 8 is selected from hydrogen, C 1 -C 4 alkyl, -(CH 2) n N(CH 3) 2, R 9 is selected from hydrogen and C 1 alkyl; each R 9' is independently selected from hydrogen and C 1 -C 3 alkyl; and R 10 is selected from hydrogen and C 1 -C 4 alkyl; or R 8 and R q, together with the nitrogen atom to which they are attached, form a ring which is wherein s is 0, 1, or 2; z is 1, 2, or 3; and each R 14 is independently selected from C 1 -C 4 alkoxycarbonyl, C 1 -C 6 alkyl, carboxy, halo, hydroxy, and hydroxyC 1 -C 4 alkyl.