universal7885: Add my makefile Generator script

Change-Id: I2ec7e72a67d73e5b9b6dd4f57557ede1651ebe03
Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
roynatech2544 2021-10-21 23:45:59 +09:00
commit b231e3bd21
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
4 changed files with 82 additions and 5 deletions

View file

@ -0,0 +1,29 @@
#include <iostream>
#include <fstream>
#include <vector>
#include <filesystem>
using namespace std;
std::vector<std::string> get_directories(const std::string& s)
{
std::vector<std::string> r;
for(auto& p : std::filesystem::recursive_directory_iterator(s))
if (p.is_directory())
r.push_back(p.path().string());
return r;
}
int main(){
std::vector<std::string> vendors = get_directories("vendor");
for (int i = 0; i < vendors.size(); i++){
std::string name = vendors[i].substr(7, vendors[i].length());
name = name.substr(0, name.find('/'));
if (name != "qcom" && name != "nxp" && name != "samsung"
&& name != "gapps" && name != "google" &&
name != "gms" && name != "codeaurora"){
ofstream output;
output.open("device/samsung/universal7885-common/vendor_name");
output << name;
output.close();
}
}
return 0;
}