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>
diff --git a/AST.cpp b/AST.cpp
index eff3369..20db9b3 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -70,7 +70,8 @@
         std::vector<FQName> packageInterfaces;
 
         status_t err =
-            mCoordinator->getPackageInterfaces(fqName, &packageInterfaces);
+            mCoordinator->appendPackageInterfacesToSet(fqName,
+                                                       &packageInterfaces);
 
         if (err != OK) {
             return false;
@@ -220,7 +221,7 @@
     }
 }
 
-void AST::addImportedPackages(std::set<FQName> *importSet) const {
+void AST::getImportedPackages(std::set<FQName> *importSet) const {
     for (const auto &fqName : mImportedNames) {
         FQName packageName(fqName.package(), fqName.version(), "");