hidl-gen: multiple changes

1. Break up generateMakefileOrSourcesForPackage() into separate
   functions for generating C++ and Android.mk files.

2. Add new command-line switch (-L) followed by a string to identify the
   code generator.  Supported code generators are -Lc++ and -Lmakefile,
   like so:

	hidl-gen -Lc++ \
		 -randroid.hardware:hardware/interfaces \
		 android.hardware.nfc@1.0

3. Remove the -m switch

4. Restore the ability to generate code for individual interfaces within
   a package, as well as for entire packages.  The following are valid
   invokations of hidl-gen:

	hidl-gen -o/tmp -Lc++ \
		 -randroid.hardware:hardware/interfaces \
		 android.hardware.nfc@1.0

	hidl-gen -o /tmp -Lc++ \
		 -randroid.hardware:hardware/interfaces \
		 android.hardware.nfc@1.0::INfc

   The first invokation will generate the following files under
   /tmp/android/hardware/nfc/1.0:

	/tmp/android/hardware/nfc/1.0/INfc.h
	/tmp/android/hardware/nfc/1.0/BnNfc.h
	/tmp/android/hardware/nfc/1.0/NfcAll.cpp
	/tmp/android/hardware/nfc/1.0/BpNfc.h

   The second invokation will result in:

	/tmp/android/hardware/nfc/1.0/types.cpp
	/tmp/android/hardware/nfc/1.0/INfc.h
	/tmp/android/hardware/nfc/1.0/BnNfc.h
	/tmp/android/hardware/nfc/1.0/NfcClientCallbackAll.cpp
	/tmp/android/hardware/nfc/1.0/NfcAll.cpp
	/tmp/android/hardware/nfc/1.0/BpNfcClientCallback.h
	/tmp/android/hardware/nfc/1.0/BpNfc.h
	/tmp/android/hardware/nfc/1.0/types.h
	/tmp/android/hardware/nfc/1.0/BnNfcClientCallback.h
	/tmp/android/hardware/nfc/1.0/INfcClientCallback.h

5. Fixed Android.mk generation to build every .hal file once.  To make,
   a HIDL interface I${name}.hal now maps to the target ${name}All.cpp

Change-Id: I83f76cbc847536bec03520bcaa39d8f449da67f2
Signed-off-by: Iliyan Malchev <malchev@google.com>
5 files changed