A convex optimization based beampattern synthesis method with antenna selection is proposed for linear and planar arrays. Conjugate symmetric beamforming weights are used so that the upper and non-convex lower bound constraints on the beampattern can be convex. Thus, a mainlobe of an arbitrary beamwidth and response ripple can be obtained. This method can achieve completely arbitrary sidelobe levels. By minimizing a re-weighted objective function based on the magnitudes of the elements in the beamforming weight vector iteratively, the proposed method selects certain antennas in an array to satisfy the prescribed beampattern specifications precisely. Interestingly, a sparse array with fewer antennas (compared to other methods) is produced. This method can design non-uniformly spaced arrays with inter-element spacings larger than one half-wavelength, without the appearance of grating lobes in the resulting beampattern. Simulations are shown using arrays of up to a few hundred antennas to illustrate the practicality of the proposed method.