From 696862b1a3025b9f054a26889f4aec42d0675f30 Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 02:03:41 +1000 Subject: Replaced narccomp with knarc --- tools/knarc/Makefile | 7 + tools/knarc/Narc.cpp | 536 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/knarc/Narc.h | 86 ++++++++ tools/knarc/Source.cpp | 109 ++++++++++ 4 files changed, 738 insertions(+) create mode 100644 tools/knarc/Makefile create mode 100644 tools/knarc/Narc.cpp create mode 100644 tools/knarc/Narc.h create mode 100644 tools/knarc/Source.cpp (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile new file mode 100644 index 00000000..a466912c --- /dev/null +++ b/tools/knarc/Makefile @@ -0,0 +1,7 @@ +all: knarc + +knarc: Source.cpp Narc.cpp + g++ -std=c++17 -o knarc Source.cpp Narc.cpp + +clean: + rm knarc diff --git a/tools/knarc/Narc.cpp b/tools/knarc/Narc.cpp new file mode 100644 index 00000000..5e2713dd --- /dev/null +++ b/tools/knarc/Narc.cpp @@ -0,0 +1,536 @@ +#include "Narc.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +void Narc::AlignDword(ofstream& ofs, uint8_t paddingChar) +{ + if ((ofs.tellp() % 4) != 0) + { + for (int i = 4 - (ofs.tellp() % 4); i-- > 0; ) + { + ofs.write(reinterpret_cast(&paddingChar), sizeof(uint8_t)); + } + } +} + +bool Narc::Cleanup(ifstream& ifs, const NarcError& e) +{ + ifs.close(); + + error = e; + + return false; +} + +bool Narc::Cleanup(ofstream& ofs, const NarcError& e) +{ + ofs.close(); + + error = e; + + return false; +} + +vector Narc::OrderedDirectoryIterator(const filesystem::path& path, bool recursive) const +{ + vector v; + + for (const auto& de : filesystem::directory_iterator(path)) + { + v.push_back(de); + } + + sort(v.begin(), v.end(), [](const filesystem::directory_entry& a, const filesystem::directory_entry& b) + { + // I fucking hate C++ + string aStr = a.path().filename().string(); + string bStr = b.path().filename().string(); + + for (size_t i = 0; i < aStr.size(); ++i) + { + aStr[i] = tolower(aStr[i]); + } + + for (size_t i = 0; i < bStr.size(); ++i) + { + bStr[i] = tolower(bStr[i]); + } + + return aStr < bStr; + }); + + if (recursive) + { + size_t vSize = v.size(); + + for (size_t i = 0; i < vSize; ++i) + { + if (v[i].is_directory()) + { + vector temp = OrderedDirectoryIterator(v[i], true); + + v.insert(v.end(), temp.begin(), temp.end()); + } + } + } + + return v; +} + +NarcError Narc::GetError() const +{ + return error; +} + +bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& directory) +{ + ofstream ofs(fileName, ios::binary); + + if (!ofs.good()) { return Cleanup(ofs, NarcError::InvalidOutputFile); } + + vector fatEntries; + uint16_t directoryCounter = 1; + + for (const auto& de : OrderedDirectoryIterator(directory, true)) + { + if (de.is_directory()) + { + ++directoryCounter; + } + else + { + fatEntries.push_back(FileAllocationTableEntry + { + .Start = 0x0, + .End = 0x0 + }); + + if (fatEntries.size() > 1) + { + fatEntries.back().Start = fatEntries.rbegin()[1].End; + + if ((fatEntries.rbegin()[1].End % 4) != 0) + { + fatEntries.back().Start += 4 - (fatEntries.rbegin()[1].End % 4); + } + } + + fatEntries.back().End = fatEntries.back().Start + static_cast(de.file_size()); + } + } + + FileAllocationTable fat + { + .Id = 0x46415442, + .ChunkSize = sizeof(FileAllocationTable) + ((uint32_t)fatEntries.size() * sizeof(FileAllocationTableEntry)), + .FileCount = static_cast(fatEntries.size()), + .Reserved = 0x0 + }; + + map subTables; + vector paths; + + directoryCounter = 0; + + for (const auto& de : OrderedDirectoryIterator(directory, true)) + { + if (!subTables.count(de.path().parent_path())) + { + subTables.insert({ de.path().parent_path(), "" }); + paths.push_back(de.path().parent_path()); + } + + if (de.is_directory()) + { + ++directoryCounter; + + subTables[de.path().parent_path()] += static_cast(0x80 + de.path().filename().string().size()); + subTables[de.path().parent_path()] += de.path().filename().string(); + subTables[de.path().parent_path()] += (0xF000 + directoryCounter) & 0xFF; + subTables[de.path().parent_path()] += (0xF000 + directoryCounter) >> 8; + } + else + { + subTables[de.path().parent_path()] += static_cast(de.path().filename().string().size()); + subTables[de.path().parent_path()] += de.path().filename().string(); + } + } + + for (auto& subTable : subTables) + { + subTable.second += '\0'; + } + + vector fntEntries; + + if (!regex_match(filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + { + fntEntries.push_back( + { + .Offset = (directoryCounter + 1) * sizeof(FileNameTableEntry), + .FirstFileId = 0x0, + .Utility = static_cast(directoryCounter + 1) + }); + + for (uint16_t i = 0; i < directoryCounter; ++i) + { + fntEntries.push_back( + { + .Offset = fntEntries.back().Offset + subTables[paths[i]].size(), + .FirstFileId = fntEntries.back().FirstFileId, + .Utility = 0x0 + }); + + for (size_t j = 0; j < (subTables[paths[i]].size() - 1); ++j) + { + if (static_cast(subTables[paths[i]][j]) <= 0x7F) + { + j += static_cast(subTables[paths[i]][j]); + ++fntEntries.back().FirstFileId; + } + else if (static_cast(subTables[paths[i]][j]) <= 0xFF) + { + j += static_cast(subTables[paths[i]][j]) - 0x80 + 0x2; + } + } + + fntEntries.back().Utility = 0xF000 + (find(paths.begin(), paths.end(), paths[i + 1].parent_path()) - paths.begin()); + } + } + else + { + fntEntries.push_back( + { + .Offset = 0x4, + .FirstFileId = 0x0, + .Utility = 0x1 + }); + } + + FileNameTable fnt + { + .Id = 0x464E5442, + .ChunkSize = sizeof(FileNameTable) + (fntEntries.size() * sizeof(FileNameTableEntry)) + }; + + if (!regex_match(filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + { + for (const auto& subTable : subTables) + { + fnt.ChunkSize += subTable.second.size(); + } + } + + if ((fnt.ChunkSize % 4) != 0) + { + fnt.ChunkSize += 4 - (fnt.ChunkSize % 4); + } + + FileImages fi + { + .Id = 0x46494D47, + .ChunkSize = sizeof(FileImages) + fatEntries.back().End + }; + + if ((fi.ChunkSize % 4) != 0) + { + fi.ChunkSize += 4 - (fi.ChunkSize % 4); + } + + Header header + { + .Id = 0x4352414E, + .ByteOrderMark = 0xFFFE, + .Version = 0x100, + .FileSize = sizeof(Header) + fat.ChunkSize + fnt.ChunkSize + fi.ChunkSize, + .ChunkSize = sizeof(Header), + .ChunkCount = 0x3 + }; + + ofs.write(reinterpret_cast(&header), sizeof(Header)); + ofs.write(reinterpret_cast(&fat), sizeof(FileAllocationTable)); + + for (auto& entry : fatEntries) + { + ofs.write(reinterpret_cast(&entry), sizeof(FileAllocationTableEntry)); + } + + ofs.write(reinterpret_cast(&fnt), sizeof(FileNameTable)); + + for (auto& entry : fntEntries) + { + ofs.write(reinterpret_cast(&entry), sizeof(FileNameTableEntry)); + } + + if (!regex_match(filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + { + for (const auto& path : paths) + { + ofs << subTables[path]; + } + } + + AlignDword(ofs, 0xFF); + + ofs.write(reinterpret_cast(&fi), sizeof(FileImages)); + + for (const auto& de : OrderedDirectoryIterator(directory, true)) + { + if (de.is_directory()) + { + continue; + } + + ifstream ifs(de.path(), ios::binary | ios::ate); + + if (!ifs.good()) + { + ifs.close(); + + return Cleanup(ofs, NarcError::InvalidInputFile); + } + + streampos length = ifs.tellg(); + unique_ptr buffer = make_unique(static_cast(length)); + + ifs.seekg(0); + ifs.read(buffer.get(), length); + ifs.close(); + + ofs.write(buffer.get(), length); + + AlignDword(ofs, 0xFF); + } + + ofs.close(); + + return error == NarcError::None ? true : false; +} + +bool Narc::Unpack(const filesystem::path& fileName, const filesystem::path& directory) +{ + ifstream ifs(fileName, ios::binary); + + if (!ifs.good()) { return Cleanup(ifs, NarcError::InvalidInputFile); } + + Header header; + ifs.read(reinterpret_cast(&header), sizeof(Header)); + + if (header.Id != 0x4352414E) { return Cleanup(ifs, NarcError::InvalidHeaderId); } + if (header.ByteOrderMark != 0xFFFE) { return Cleanup(ifs, NarcError::InvalidByteOrderMark); } + if ((header.Version != 0x0100) && (header.Version != 0x0000)) { return Cleanup(ifs, NarcError::InvalidVersion); } + if (header.ChunkSize != 0x10) { return Cleanup(ifs, NarcError::InvalidHeaderSize); } + if (header.ChunkCount != 0x3) { return Cleanup(ifs, NarcError::InvalidChunkCount); } + + FileAllocationTable fat; + ifs.read(reinterpret_cast(&fat), sizeof(FileAllocationTable)); + + if (fat.Id != 0x46415442) { return Cleanup(ifs, NarcError::InvalidFileAllocationTableId); } + if (fat.Reserved != 0x0) { return Cleanup(ifs, NarcError::InvalidFileAllocationTableReserved); } + + unique_ptr fatEntries = make_unique(fat.FileCount); + + for (uint16_t i = 0; i < fat.FileCount; ++i) + { + ifs.read(reinterpret_cast(&fatEntries.get()[i]), sizeof(FileAllocationTableEntry)); + } + + FileNameTable fnt; + vector FileNameTableEntries; + ifs.read(reinterpret_cast(&fnt), sizeof(FileNameTable)); + + if (fnt.Id != 0x464E5442) { return Cleanup(ifs, NarcError::InvalidFileNameTableId); } + + vector fntEntries; + + do + { + fntEntries.push_back(FileNameTableEntry()); + + ifs.read(reinterpret_cast(&fntEntries.back().Offset), sizeof(uint32_t)); + ifs.read(reinterpret_cast(&fntEntries.back().FirstFileId), sizeof(uint16_t)); + ifs.read(reinterpret_cast(&fntEntries.back().Utility), sizeof(uint16_t)); + } while (static_cast(ifs.tellg()) < (header.ChunkSize + fat.ChunkSize + sizeof(FileNameTable) + fntEntries[0].Offset)); + + unique_ptr fileNames = make_unique(0xFFFF); + + for (size_t i = 0; i < fntEntries.size(); ++i) + { + ifs.seekg(static_cast(header.ChunkSize) + fat.ChunkSize + sizeof(FileNameTable) + fntEntries[i].Offset); + + uint16_t fileId = 0x0000; + + for (uint8_t length = 0x80; length != 0x00; ifs.read(reinterpret_cast(&length), sizeof(uint8_t))) + { + if (length <= 0x7F) + { + for (uint8_t j = 0; j < length; ++j) + { + uint8_t c; + ifs.read(reinterpret_cast(&c), sizeof(uint8_t)); + + fileNames.get()[fntEntries[i].FirstFileId + fileId] += c; + } + + ++fileId; + } + else if (length == 0x80) + { + // Reserved + } + else if (length <= 0xFF) + { + length -= 0x80; + string directoryName; + + for (uint8_t j = 0; j < length; ++j) + { + uint8_t c; + ifs.read(reinterpret_cast(&c), sizeof(uint8_t)); + + directoryName += c; + } + + uint16_t directoryId; + ifs.read(reinterpret_cast(&directoryId), sizeof(uint16_t)); + + fileNames.get()[directoryId] = directoryName; + } + else + { + return Cleanup(ifs, NarcError::InvalidFileNameTableEntryId); + } + } + } + + if ((ifs.tellg() % 4) != 0) + { + ifs.seekg(4 - (ifs.tellg() % 4), ios::cur); + } + + FileImages fi; + ifs.read(reinterpret_cast(&fi), sizeof(FileImages)); + + if (fi.Id != 0x46494D47) { return Cleanup(ifs, NarcError::InvalidFileImagesId); } + + filesystem::create_directory(directory); + filesystem::current_path(directory); + + if (fnt.ChunkSize == 0x10) + { + for (uint16_t i = 0; i < fat.FileCount; ++i) + { + ifs.seekg(static_cast(header.ChunkSize) + fat.ChunkSize + fnt.ChunkSize + 8 + fatEntries.get()[i].Start); + + unique_ptr buffer = make_unique(fatEntries.get()[i].End - fatEntries.get()[i].Start); + ifs.read(buffer.get(), fatEntries.get()[i].End - fatEntries.get()[i].Start); + + ostringstream oss; + oss << fileName.stem().string() << "_" << setfill('0') << setw(8) << i << ".bin"; + + ofstream ofs(oss.str(), ios::binary); + + if (!ofs.good()) + { + ofs.close(); + + return Cleanup(ifs, NarcError::InvalidOutputFile); + } + + ofs.write(buffer.get(), fatEntries.get()[i].End - fatEntries.get()[i].Start); + ofs.close(); + } + } + else + { + filesystem::path absolutePath = filesystem::absolute(filesystem::current_path()); + + for (size_t i = 0; i < fntEntries.size(); ++i) + { + filesystem::current_path(absolutePath); + stack directories; + + for (uint16_t j = fntEntries[i].Utility; j > 0xF000; j = fntEntries[j - 0xF000].Utility) + { + directories.push(fileNames.get()[j]); + } + + for (; !directories.empty(); directories.pop()) + { + filesystem::create_directory(directories.top()); + filesystem::current_path(directories.top()); + } + + if (fntEntries[i].Utility >= 0xF000) + { + filesystem::create_directory(fileNames.get()[0xF000 + i]); + filesystem::current_path(fileNames.get()[0xF000 + i]); + } + + ifs.seekg(static_cast(header.ChunkSize) + fat.ChunkSize + sizeof(FileNameTable) + fntEntries[i].Offset); + + uint16_t fileId = 0x0000; + + for (uint8_t length = 0x80; length != 0x00; ifs.read(reinterpret_cast(&length), sizeof(uint8_t))) + { + if (length <= 0x7F) + { + streampos savedPosition = ifs.tellg(); + + ifs.seekg(static_cast(header.ChunkSize) + fat.ChunkSize + fnt.ChunkSize + 8 + fatEntries.get()[fntEntries[i].FirstFileId + fileId].Start); + + unique_ptr buffer = make_unique(fatEntries.get()[fntEntries[i].FirstFileId + fileId].End - fatEntries.get()[fntEntries[i].FirstFileId + fileId].Start); + ifs.read(buffer.get(), fatEntries.get()[fntEntries[i].FirstFileId + fileId].End - fatEntries.get()[fntEntries[i].FirstFileId + fileId].Start); + + ofstream ofs(fileNames.get()[fntEntries[i].FirstFileId + fileId], ios::binary); + + if (!ofs.good()) + { + ofs.close(); + + return Cleanup(ifs, NarcError::InvalidOutputFile); + } + + ofs.write(buffer.get(), fatEntries.get()[fntEntries[i].FirstFileId + fileId].End - fatEntries.get()[fntEntries[i].FirstFileId + fileId].Start); + ofs.close(); + + ifs.seekg(savedPosition); + ifs.seekg(length, ios::cur); + + ++fileId; + } + else if (length == 0x80) + { + // Reserved + } + else if (length <= 0xFF) + { + ifs.seekg(static_cast(length) - 0x80 + 0x2, ios::cur); + } + else + { + return Cleanup(ifs, NarcError::InvalidFileNameTableEntryId); + } + } + } + } + + ifs.close(); + + return error == NarcError::None ? true : false; +} diff --git a/tools/knarc/Narc.h b/tools/knarc/Narc.h new file mode 100644 index 00000000..d9de52bb --- /dev/null +++ b/tools/knarc/Narc.h @@ -0,0 +1,86 @@ +#pragma once + +#include +#include +#include +#include +#include + +enum class NarcError +{ + None, + InvalidInputFile, + InvalidHeaderId, + InvalidByteOrderMark, + InvalidVersion, + InvalidHeaderSize, + InvalidChunkCount, + InvalidFileAllocationTableId, + InvalidFileAllocationTableReserved, + InvalidFileNameTableId, + InvalidFileNameTableEntryId, + InvalidFileImagesId, + InvalidOutputFile +}; + +struct Header +{ + uint32_t Id; + uint16_t ByteOrderMark; + uint16_t Version; + uint32_t FileSize; + uint16_t ChunkSize; + uint16_t ChunkCount; +}; + +struct FileAllocationTable +{ + uint32_t Id; + uint32_t ChunkSize; + uint16_t FileCount; + uint16_t Reserved; +}; + +struct FileAllocationTableEntry +{ + uint32_t Start; + uint32_t End; +}; + +struct FileNameTable +{ + uint32_t Id; + uint32_t ChunkSize; +}; + +struct FileNameTableEntry +{ + uint32_t Offset; + uint16_t FirstFileId; + uint16_t Utility; +}; + +struct FileImages +{ + uint32_t Id; + uint32_t ChunkSize; +}; + +class Narc +{ + public: + NarcError GetError() const; + + bool Pack(const std::filesystem::path& fileName, const std::filesystem::path& directory); + bool Unpack(const std::filesystem::path& fileName, const std::filesystem::path& directory); + + private: + NarcError error = NarcError::None; + + void AlignDword(std::ofstream& ofs, uint8_t paddingChar); + + bool Cleanup(std::ifstream& ifs, const NarcError& e); + bool Cleanup(std::ofstream& ofs, const NarcError& e); + + std::vector OrderedDirectoryIterator(const std::filesystem::path& path, bool recursive) const; +}; diff --git a/tools/knarc/Source.cpp b/tools/knarc/Source.cpp new file mode 100644 index 00000000..3678997c --- /dev/null +++ b/tools/knarc/Source.cpp @@ -0,0 +1,109 @@ +#include +#include +#include +#include + +#include "Narc.h" + +using namespace std; + +void PrintError(NarcError error) +{ + switch (error) + { + case NarcError::None: cout << "ERROR: No error???" << endl; break; + case NarcError::InvalidInputFile: cout << "ERROR: Invalid input file" << endl; break; + case NarcError::InvalidHeaderId: cout << "ERROR: Invalid header ID" << endl; break; + case NarcError::InvalidByteOrderMark: cout << "ERROR: Invalid byte order mark" << endl; break; + case NarcError::InvalidVersion: cout << "ERROR: Invalid NARC version" << endl; break; + case NarcError::InvalidHeaderSize: cout << "ERROR: Invalid header size" << endl; break; + case NarcError::InvalidChunkCount: cout << "ERROR: Invalid chunk count" << endl; break; + case NarcError::InvalidFileAllocationTableId: cout << "ERROR: Invalid file allocation table ID" << endl; break; + case NarcError::InvalidFileAllocationTableReserved: cout << "ERROR: Invalid file allocation table reserved section" << endl; break; + case NarcError::InvalidFileNameTableId: cout << "ERROR: Invalid file name table ID" << endl; break; + case NarcError::InvalidFileNameTableEntryId: cout << "ERROR: Invalid file name table entry ID" << endl; break; + case NarcError::InvalidFileImagesId: cout << "ERROR: Invalid file images ID" << endl; break; + case NarcError::InvalidOutputFile: cout << "ERROR: Invalid output file" << endl; break; + default: cout << "ERROR: Unknown error???" << endl; break; + } +} + +int main(int argc, char* argv[]) +{ + if (argc != 5) + { + cout << "OVERVIEW: Knarc" << endl << endl; + cout << "USAGE: knarc [options] " << endl << endl; + cout << "OPTIONS:" << endl; + cout << "\t-d\tDirectory to pack from/unpack to" << endl; + cout << "\t-p\tPack" << endl; + cout << "\t-u\tUnpack" << endl; + + return 1; + } + + string directory = ""; + string fileName = ""; + bool pack = false; + + for (int i = 1; i < argc; ++i) + { + if (!strcmp(argv[i], "-d")) + { + if (i == (argc - 1)) + { + cerr << "ERROR: No directory specified" << endl; + + return 1; + } + + directory = argv[++i]; + } + else if (!strcmp(argv[i], "-p")) + { + if (i == (argc - 1)) + { + cerr << "ERROR: No NARC specified to pack to" << endl; + + return 1; + } + + fileName = argv[++i]; + pack = true; + } + else if (!strcmp(argv[i], "-u")) + { + if (i == (argc - 1)) + { + cerr << "ERROR: No NARC specified to unpack from" << endl; + + return 1; + } + + fileName = argv[++i]; + } + } + + Narc narc; + + if (pack) + { + if (!narc.Pack(fileName, directory)) + { + PrintError(narc.GetError()); + + return 1; + } + } + else + { + if (!narc.Unpack(fileName, directory)) + { + PrintError(narc.GetError()); + + return 1; + } + } + + return 0; +} -- cgit v1.2.3 From d419d521b3d0c65aef90299ef1a183382a055ed4 Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 02:12:10 +1000 Subject: Added .gitignore for compiled binary --- tools/knarc/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/knarc/.gitignore (limited to 'tools/knarc') diff --git a/tools/knarc/.gitignore b/tools/knarc/.gitignore new file mode 100644 index 00000000..20bde9af --- /dev/null +++ b/tools/knarc/.gitignore @@ -0,0 +1 @@ +knarc -- cgit v1.2.3 From 0eb4920e8ee15cdc5bc42fbbb7927d34e3014cf1 Mon Sep 17 00:00:00 2001 From: PlatinumMaster Date: Sun, 7 Jun 2020 13:05:55 -0400 Subject: Update Makefile to support g++8. --- tools/knarc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index a466912c..da52e871 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,7 +1,7 @@ all: knarc knarc: Source.cpp Narc.cpp - g++ -std=c++17 -o knarc Source.cpp Narc.cpp + g++8 -std=c++17 -o knarc Source.cpp Narc.cpp clean: - rm knarc + rm knarc \ No newline at end of file -- cgit v1.2.3 From e6cf189c302f8a0659dddccd38b1819239618e0b Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 03:26:25 +1000 Subject: My turn to try and fix Travis --- tools/knarc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index da52e871..a466912c 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,7 +1,7 @@ all: knarc knarc: Source.cpp Narc.cpp - g++8 -std=c++17 -o knarc Source.cpp Narc.cpp + g++ -std=c++17 -o knarc Source.cpp Narc.cpp clean: - rm knarc \ No newline at end of file + rm knarc -- cgit v1.2.3 From e80bd72182be2db282150e1522ed6d30e151c5c7 Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 03:44:31 +1000 Subject: Changed GCC 9 back to GCC 8 and added fs flag --- tools/knarc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index a466912c..db803d8b 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,7 +1,7 @@ all: knarc knarc: Source.cpp Narc.cpp - g++ -std=c++17 -o knarc Source.cpp Narc.cpp + g++ -std=c++17 -lstdc++fs -o knarc Source.cpp Narc.cpp clean: rm knarc -- cgit v1.2.3 From 24764e2481b702655329fb810ed1ae34067cd4ed Mon Sep 17 00:00:00 2001 From: PlatinumMaster Date: Sun, 7 Jun 2020 14:24:18 -0400 Subject: Change order of linked files. --- tools/knarc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index db803d8b..3f0e6492 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,7 +1,7 @@ all: knarc knarc: Source.cpp Narc.cpp - g++ -std=c++17 -lstdc++fs -o knarc Source.cpp Narc.cpp + g++ -std=c++17 -o knarc Source.cpp Narc.cpp -lstdc++fs clean: rm knarc -- cgit v1.2.3 From 7860c28c3fbf0686c5b4bcf50a9ebe3ca725fe6f Mon Sep 17 00:00:00 2001 From: PlatinumMaster Date: Sun, 7 Jun 2020 14:34:31 -0400 Subject: Force g++-8 usage. --- tools/knarc/Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index 3f0e6492..3a31e6dc 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,7 +1,15 @@ -all: knarc +CXXFLAGS := -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs + +SRCS := Source.cpp Narc.cpp +HEADERS := Narc.h -knarc: Source.cpp Narc.cpp - g++ -std=c++17 -o knarc Source.cpp Narc.cpp -lstdc++fs +.PHONY: all clean + +all: knarc + @: + +knarc: $(SRCS) $(HEADERS) + g++-8 $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: - rm knarc + $(RM) knarc knarc.exe -- cgit v1.2.3 From 98a0ac436c01d867566bfdd4ecda2e8603f2278d Mon Sep 17 00:00:00 2001 From: PlatinumMaster Date: Sun, 7 Jun 2020 14:49:52 -0400 Subject: Update Makefile. --- tools/knarc/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index 3a31e6dc..4e5e7971 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,3 +1,5 @@ +CXX ?= g++-9 + CXXFLAGS := -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs SRCS := Source.cpp Narc.cpp @@ -9,7 +11,7 @@ all: knarc @: knarc: $(SRCS) $(HEADERS) - g++-8 $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) + $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: $(RM) knarc knarc.exe -- cgit v1.2.3 From d20e69e76fa290e29b570fe051ea8a12548db97a Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 05:17:22 +1000 Subject: Changed filesystem to experimental/filesystem --- tools/knarc/Makefile | 4 ++-- tools/knarc/Narc.cpp | 52 +++++++++++++++++++++++++------------------------- tools/knarc/Narc.h | 8 ++++---- tools/knarc/Source.cpp | 1 - 4 files changed, 32 insertions(+), 33 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index 4e5e7971..336fad3f 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -9,9 +9,9 @@ HEADERS := Narc.h all: knarc @: - + knarc: $(SRCS) $(HEADERS) - $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) + $(CXX) $(SRCS) -o $@ $(LDFLAGS) $(CXXFLAGS) clean: $(RM) knarc knarc.exe diff --git a/tools/knarc/Narc.cpp b/tools/knarc/Narc.cpp index 5e2713dd..4cdb4b63 100644 --- a/tools/knarc/Narc.cpp +++ b/tools/knarc/Narc.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -46,16 +46,16 @@ bool Narc::Cleanup(ofstream& ofs, const NarcError& e) return false; } -vector Narc::OrderedDirectoryIterator(const filesystem::path& path, bool recursive) const +vector Narc::OrderedDirectoryIterator(const experimental::filesystem::path& path, bool recursive) const { - vector v; + vector v; - for (const auto& de : filesystem::directory_iterator(path)) + for (const auto& de : experimental::filesystem::directory_iterator(path)) { v.push_back(de); } - sort(v.begin(), v.end(), [](const filesystem::directory_entry& a, const filesystem::directory_entry& b) + sort(v.begin(), v.end(), [](const experimental::filesystem::directory_entry& a, const experimental::filesystem::directory_entry& b) { // I fucking hate C++ string aStr = a.path().filename().string(); @@ -80,9 +80,9 @@ vector Narc::OrderedDirectoryIterator(const filesys for (size_t i = 0; i < vSize; ++i) { - if (v[i].is_directory()) + if (is_directory(v[i])) { - vector temp = OrderedDirectoryIterator(v[i], true); + vector temp = OrderedDirectoryIterator(v[i], true); v.insert(v.end(), temp.begin(), temp.end()); } @@ -97,7 +97,7 @@ NarcError Narc::GetError() const return error; } -bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& directory) +bool Narc::Pack(const experimental::filesystem::path& fileName, const experimental::filesystem::path& directory) { ofstream ofs(fileName, ios::binary); @@ -108,7 +108,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct for (const auto& de : OrderedDirectoryIterator(directory, true)) { - if (de.is_directory()) + if (is_directory(de)) { ++directoryCounter; } @@ -130,7 +130,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct } } - fatEntries.back().End = fatEntries.back().Start + static_cast(de.file_size()); + fatEntries.back().End = fatEntries.back().Start + static_cast(file_size(de)); } } @@ -142,8 +142,8 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct .Reserved = 0x0 }; - map subTables; - vector paths; + map subTables; + vector paths; directoryCounter = 0; @@ -155,7 +155,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct paths.push_back(de.path().parent_path()); } - if (de.is_directory()) + if (is_directory(de)) { ++directoryCounter; @@ -178,7 +178,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct vector fntEntries; - if (!regex_match(filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + if (!regex_match(experimental::filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) { fntEntries.push_back( { @@ -228,7 +228,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct .ChunkSize = sizeof(FileNameTable) + (fntEntries.size() * sizeof(FileNameTableEntry)) }; - if (!regex_match(filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + if (!regex_match(experimental::filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) { for (const auto& subTable : subTables) { @@ -277,7 +277,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct ofs.write(reinterpret_cast(&entry), sizeof(FileNameTableEntry)); } - if (!regex_match(filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + if (!regex_match(experimental::filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) { for (const auto& path : paths) { @@ -291,7 +291,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct for (const auto& de : OrderedDirectoryIterator(directory, true)) { - if (de.is_directory()) + if (is_directory(de)) { continue; } @@ -322,7 +322,7 @@ bool Narc::Pack(const filesystem::path& fileName, const filesystem::path& direct return error == NarcError::None ? true : false; } -bool Narc::Unpack(const filesystem::path& fileName, const filesystem::path& directory) +bool Narc::Unpack(const experimental::filesystem::path& fileName, const experimental::filesystem::path& directory) { ifstream ifs(fileName, ios::binary); @@ -428,8 +428,8 @@ bool Narc::Unpack(const filesystem::path& fileName, const filesystem::path& dire if (fi.Id != 0x46494D47) { return Cleanup(ifs, NarcError::InvalidFileImagesId); } - filesystem::create_directory(directory); - filesystem::current_path(directory); + experimental::filesystem::create_directory(directory); + experimental::filesystem::current_path(directory); if (fnt.ChunkSize == 0x10) { @@ -458,11 +458,11 @@ bool Narc::Unpack(const filesystem::path& fileName, const filesystem::path& dire } else { - filesystem::path absolutePath = filesystem::absolute(filesystem::current_path()); + experimental::filesystem::path absolutePath = experimental::filesystem::absolute(experimental::filesystem::current_path()); for (size_t i = 0; i < fntEntries.size(); ++i) { - filesystem::current_path(absolutePath); + experimental::filesystem::current_path(absolutePath); stack directories; for (uint16_t j = fntEntries[i].Utility; j > 0xF000; j = fntEntries[j - 0xF000].Utility) @@ -472,14 +472,14 @@ bool Narc::Unpack(const filesystem::path& fileName, const filesystem::path& dire for (; !directories.empty(); directories.pop()) { - filesystem::create_directory(directories.top()); - filesystem::current_path(directories.top()); + experimental::filesystem::create_directory(directories.top()); + experimental::filesystem::current_path(directories.top()); } if (fntEntries[i].Utility >= 0xF000) { - filesystem::create_directory(fileNames.get()[0xF000 + i]); - filesystem::current_path(fileNames.get()[0xF000 + i]); + experimental::filesystem::create_directory(fileNames.get()[0xF000 + i]); + experimental::filesystem::current_path(fileNames.get()[0xF000 + i]); } ifs.seekg(static_cast(header.ChunkSize) + fat.ChunkSize + sizeof(FileNameTable) + fntEntries[i].Offset); diff --git a/tools/knarc/Narc.h b/tools/knarc/Narc.h index d9de52bb..515a1cc2 100644 --- a/tools/knarc/Narc.h +++ b/tools/knarc/Narc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include #include @@ -71,8 +71,8 @@ class Narc public: NarcError GetError() const; - bool Pack(const std::filesystem::path& fileName, const std::filesystem::path& directory); - bool Unpack(const std::filesystem::path& fileName, const std::filesystem::path& directory); + bool Pack(const std::experimental::filesystem::path& fileName, const std::experimental::filesystem::path& directory); + bool Unpack(const std::experimental::filesystem::path& fileName, const std::experimental::filesystem::path& directory); private: NarcError error = NarcError::None; @@ -82,5 +82,5 @@ class Narc bool Cleanup(std::ifstream& ifs, const NarcError& e); bool Cleanup(std::ofstream& ofs, const NarcError& e); - std::vector OrderedDirectoryIterator(const std::filesystem::path& path, bool recursive) const; + std::vector OrderedDirectoryIterator(const std::experimental::filesystem::path& path, bool recursive) const; }; diff --git a/tools/knarc/Source.cpp b/tools/knarc/Source.cpp index 3678997c..51bb5320 100644 --- a/tools/knarc/Source.cpp +++ b/tools/knarc/Source.cpp @@ -1,5 +1,4 @@ #include -#include #include #include -- cgit v1.2.3 From 19d0c085f76ac5830e38339248d2f70b58ee54b2 Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 05:54:51 +1000 Subject: Added preprocessor macros to switch experimental on and off --- tools/knarc/Narc.cpp | 49 ++++++++++++++++++++++++++++--------------------- tools/knarc/Narc.h | 15 +++++++++++---- 2 files changed, 39 insertions(+), 25 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Narc.cpp b/tools/knarc/Narc.cpp index 4cdb4b63..506e050f 100644 --- a/tools/knarc/Narc.cpp +++ b/tools/knarc/Narc.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -15,6 +14,14 @@ #include #include +#if __GNUC__ <= 7 +#include +namespace fs = std::experimental::filesystem; +#else +#include +namespace fs = std::filesystem; +#endif + using namespace std; void Narc::AlignDword(ofstream& ofs, uint8_t paddingChar) @@ -46,16 +53,16 @@ bool Narc::Cleanup(ofstream& ofs, const NarcError& e) return false; } -vector Narc::OrderedDirectoryIterator(const experimental::filesystem::path& path, bool recursive) const +vector Narc::OrderedDirectoryIterator(const fs::path& path, bool recursive) const { - vector v; + vector v; - for (const auto& de : experimental::filesystem::directory_iterator(path)) + for (const auto& de : fs::directory_iterator(path)) { v.push_back(de); } - sort(v.begin(), v.end(), [](const experimental::filesystem::directory_entry& a, const experimental::filesystem::directory_entry& b) + sort(v.begin(), v.end(), [](const fs::directory_entry& a, const fs::directory_entry& b) { // I fucking hate C++ string aStr = a.path().filename().string(); @@ -82,7 +89,7 @@ vector Narc::OrderedDirectoryIterator { if (is_directory(v[i])) { - vector temp = OrderedDirectoryIterator(v[i], true); + vector temp = OrderedDirectoryIterator(v[i], true); v.insert(v.end(), temp.begin(), temp.end()); } @@ -97,7 +104,7 @@ NarcError Narc::GetError() const return error; } -bool Narc::Pack(const experimental::filesystem::path& fileName, const experimental::filesystem::path& directory) +bool Narc::Pack(const fs::path& fileName, const fs::path& directory) { ofstream ofs(fileName, ios::binary); @@ -142,8 +149,8 @@ bool Narc::Pack(const experimental::filesystem::path& fileName, const experiment .Reserved = 0x0 }; - map subTables; - vector paths; + map subTables; + vector paths; directoryCounter = 0; @@ -178,7 +185,7 @@ bool Narc::Pack(const experimental::filesystem::path& fileName, const experiment vector fntEntries; - if (!regex_match(experimental::filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + if (!regex_match(fs::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) { fntEntries.push_back( { @@ -228,7 +235,7 @@ bool Narc::Pack(const experimental::filesystem::path& fileName, const experiment .ChunkSize = sizeof(FileNameTable) + (fntEntries.size() * sizeof(FileNameTableEntry)) }; - if (!regex_match(experimental::filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + if (!regex_match(fs::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) { for (const auto& subTable : subTables) { @@ -277,7 +284,7 @@ bool Narc::Pack(const experimental::filesystem::path& fileName, const experiment ofs.write(reinterpret_cast(&entry), sizeof(FileNameTableEntry)); } - if (!regex_match(experimental::filesystem::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) + if (!regex_match(fs::directory_iterator(directory)->path().string(), regex(".*_\\d{4,8}\\.bin"))) { for (const auto& path : paths) { @@ -322,7 +329,7 @@ bool Narc::Pack(const experimental::filesystem::path& fileName, const experiment return error == NarcError::None ? true : false; } -bool Narc::Unpack(const experimental::filesystem::path& fileName, const experimental::filesystem::path& directory) +bool Narc::Unpack(const fs::path& fileName, const fs::path& directory) { ifstream ifs(fileName, ios::binary); @@ -428,8 +435,8 @@ bool Narc::Unpack(const experimental::filesystem::path& fileName, const experime if (fi.Id != 0x46494D47) { return Cleanup(ifs, NarcError::InvalidFileImagesId); } - experimental::filesystem::create_directory(directory); - experimental::filesystem::current_path(directory); + fs::create_directory(directory); + fs::current_path(directory); if (fnt.ChunkSize == 0x10) { @@ -458,11 +465,11 @@ bool Narc::Unpack(const experimental::filesystem::path& fileName, const experime } else { - experimental::filesystem::path absolutePath = experimental::filesystem::absolute(experimental::filesystem::current_path()); + fs::path absolutePath = fs::absolute(fs::current_path()); for (size_t i = 0; i < fntEntries.size(); ++i) { - experimental::filesystem::current_path(absolutePath); + fs::current_path(absolutePath); stack directories; for (uint16_t j = fntEntries[i].Utility; j > 0xF000; j = fntEntries[j - 0xF000].Utility) @@ -472,14 +479,14 @@ bool Narc::Unpack(const experimental::filesystem::path& fileName, const experime for (; !directories.empty(); directories.pop()) { - experimental::filesystem::create_directory(directories.top()); - experimental::filesystem::current_path(directories.top()); + fs::create_directory(directories.top()); + fs::current_path(directories.top()); } if (fntEntries[i].Utility >= 0xF000) { - experimental::filesystem::create_directory(fileNames.get()[0xF000 + i]); - experimental::filesystem::current_path(fileNames.get()[0xF000 + i]); + fs::create_directory(fileNames.get()[0xF000 + i]); + fs::current_path(fileNames.get()[0xF000 + i]); } ifs.seekg(static_cast(header.ChunkSize) + fat.ChunkSize + sizeof(FileNameTable) + fntEntries[i].Offset); diff --git a/tools/knarc/Narc.h b/tools/knarc/Narc.h index 515a1cc2..4516d2d5 100644 --- a/tools/knarc/Narc.h +++ b/tools/knarc/Narc.h @@ -1,11 +1,18 @@ #pragma once #include -#include #include #include #include +#if __GNUC__ <= 7 +#include +namespace fs = std::experimental::filesystem; +#else +#include +namespace fs = std::filesystem; +#endif + enum class NarcError { None, @@ -71,8 +78,8 @@ class Narc public: NarcError GetError() const; - bool Pack(const std::experimental::filesystem::path& fileName, const std::experimental::filesystem::path& directory); - bool Unpack(const std::experimental::filesystem::path& fileName, const std::experimental::filesystem::path& directory); + bool Pack(const fs::path& fileName, const fs::path& directory); + bool Unpack(const fs::path& fileName, const fs::path& directory); private: NarcError error = NarcError::None; @@ -82,5 +89,5 @@ class Narc bool Cleanup(std::ifstream& ifs, const NarcError& e); bool Cleanup(std::ofstream& ofs, const NarcError& e); - std::vector OrderedDirectoryIterator(const std::experimental::filesystem::path& path, bool recursive) const; + std::vector OrderedDirectoryIterator(const fs::path& path, bool recursive) const; }; -- cgit v1.2.3 From a7b3fd6036a4a629cc25fbcf21fb655aac90a2bc Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 20:36:34 +1000 Subject: Amended knarc makefile so as not to conflict with devkitARM --- tools/knarc/Makefile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index 336fad3f..f8f263d2 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,17 +1,10 @@ -CXX ?= g++-9 - -CXXFLAGS := -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs - -SRCS := Source.cpp Narc.cpp -HEADERS := Narc.h - .PHONY: all clean all: knarc @: -knarc: $(SRCS) $(HEADERS) - $(CXX) $(SRCS) -o $@ $(LDFLAGS) $(CXXFLAGS) +knarc: Source.cpp Narc.cpp Narc.h + g++-9 Source.cpp Narc.cpp -o $@ -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs clean: $(RM) knarc knarc.exe -- cgit v1.2.3 From 9243be03ab56a74fd083205c9a2017e4fc4b4ff6 Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 20:41:34 +1000 Subject: Changed g++-9 to g++ in knarc makefile --- tools/knarc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index f8f263d2..3fc47182 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -4,7 +4,7 @@ all: knarc @: knarc: Source.cpp Narc.cpp Narc.h - g++-9 Source.cpp Narc.cpp -o $@ -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs + g++ Source.cpp Narc.cpp -o $@ -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs clean: $(RM) knarc knarc.exe -- cgit v1.2.3 From 1dd31333cf0734259f720fdcb5bbef5145d07292 Mon Sep 17 00:00:00 2001 From: kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> Date: Mon, 8 Jun 2020 22:42:54 +1000 Subject: Changed first line of knarc makefile --- tools/knarc/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index 3fc47182..2e851af6 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,10 +1,17 @@ +CXX := g++ + +CXXFLAGS := -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs + +SRCS := Source.cpp Narc.cpp +HEADERS := Narc.h + .PHONY: all clean all: knarc @: -knarc: Source.cpp Narc.cpp Narc.h - g++ Source.cpp Narc.cpp -o $@ -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs +knarc: $(SRCS) $(HEADERS) + $(CXX) $(SRCS) -o $@ $(LDFLAGS) $(CXXFLAGS) clean: $(RM) knarc knarc.exe -- cgit v1.2.3 From 672325017c48804a933ef944e63f2b5918763f7f Mon Sep 17 00:00:00 2001 From: mid-kid Date: Mon, 8 Jun 2020 14:57:36 +0200 Subject: Pass down host variables --- tools/knarc/Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'tools/knarc') diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index 2e851af6..62af834f 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -1,5 +1,3 @@ -CXX := g++ - CXXFLAGS := -std=c++17 -O2 -Wall -Wno-switch -lstdc++fs SRCS := Source.cpp Narc.cpp -- cgit v1.2.3