Can I deduct purchasing closing costs on sale of rental property?

In 2008 I  purchased a condo and used it as rental property.  I sold it in 2017.  Can I add the closing costs of the purchase in 2008  to the cost basis?  I know I can add the closing costs of the sale.