Use 1" x1" cleats glued and screwed with short screws into the closet walls. Or, if your closet walls are paper thin, just use glue and tape the cleats in place until the glue hardens. An alternative, if your closet walls are 1/2" thick or greater, is to use shelf pins. You should use a drill stop so the holes you drill for the shelf pins do not become a through hole in the closet walls. Shelf pins will be the cheapest way to support the shelves.