The invention relates to a preparation method of a selective and reversible inhibitor tadalafil of cyclic guanosine monophosphate (cGMP) specific phosphodiesterase 5 (PDE5). The method comprises the following steps: carrying out an esterification reaction on D-tryptophan as an initial raw material and methanol under catalysis of sulfuric acid to generate D-tryptophan methyl ester (an intermediate1); carrying out a Pictet-Spengler (P-S) reaction on the D-tryptophan methyl ester and heliotropin to prepare (1R,3R)-1-(1,3-benzodioxol-5-yl)-2,3,4,9-tetrahydro-1H-pyrido[3,4-b]indole-3-carboxylic acid methyl ester hydrochloride (an intermediate 2); carrying out an amidation reaction on the (1R,3R)-1-(1,3-benzodioxol-5-yl)-2,3,4,9-tetrahydro-1H-pyrido[3,4-b]indole-3-carboxylic acid methyl ester hydrochloride and chloroacetyl chloride to prepare (1R,3R)-1-(1,3-benzodioxol-5-yl)-2-(2-chloroacetyl)-2,3,4,9-tetrahydro-1H-pyrido[3,4-b]indole-3-carboxylic acid methyl ester (an intermediate 3); andfinally carrying out a cyclization reaction on the (1R,3R)-1-(1,3-benzodioxol-5-yl)-2-(2-chloroacetyl)-2,3,4,9-tetrahydro-1H-pyrido[3,4-b]indole-3-carboxylic acid methyl ester and a methylamine alcohol solution to obtain the tadalafil. The method provided by the invention has the advantages of easily available raw materials, simple operation, greenness, environmental protection and low costs, andis suitable for industrial production.