diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | XMakefile | 7 | ||||
-rw-r--r-- | YMakefile | 8 | ||||
-rw-r--r-- | builder.cpp | 14 | ||||
-rw-r--r-- | debian/README.Debian | 6 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/control | 10 | ||||
-rw-r--r-- | main.cpp | 4 | ||||
-rw-r--r-- | xmake.h | 4 | ||||
-rw-r--r-- | ymake.cpp (renamed from xmake.cpp) | 12 | ||||
-rw-r--r-- | ymake.h | 4 |
11 files changed, 38 insertions, 37 deletions
@@ -1,6 +1,6 @@ -PROJECTNAME=xmake +PROJECTNAME=ymake -SRC=main.cpp xmake.cpp builder.cpp +SRC=main.cpp ymake.cpp builder.cpp OBJ=$(SRC:.cpp=.o) diff --git a/XMakefile b/XMakefile deleted file mode 100644 index ac3a34e..0000000 --- a/XMakefile +++ /dev/null @@ -1,7 +0,0 @@ -<xmake> - <build> - <name>xmake</name> - <source>xmake.cpp</source> - <source>main.cpp</source> - </build> -</xmake> diff --git a/YMakefile b/YMakefile new file mode 100644 index 0000000..152ccc6 --- /dev/null +++ b/YMakefile @@ -0,0 +1,8 @@ +<ymake> + <build> + <name>ymake</name> + <source>builder.cpp</source> + <source>main.cpp</source> + <source>ymake.cpp</source> + </build> +</ymake> diff --git a/builder.cpp b/builder.cpp index 0493bb3..ee9c16b 100644 --- a/builder.cpp +++ b/builder.cpp @@ -29,12 +29,12 @@ using namespace std::string_literals; namespace { fs::path get_target(const pt::ptree& ptree) { - return ptree.get<std::string>("xmake.build.name"); + return ptree.get<std::string>("ymake.build.name"); } std::vector<fs::path> get_sources(const pt::ptree& ptree) { std::vector<fs::path> sources; - for (const pt::ptree::value_type &v: ptree.get_child("xmake.build")) { + for (const pt::ptree::value_type &v: ptree.get_child("ymake.build")) { if (v.first == "source") sources.push_back(v.second.data()); } @@ -120,7 +120,8 @@ namespace { fs::path p_obj{p}; p_obj.replace_extension("o"); std::vector<fs::path> deps {make_depfile_from(p)}; - fs::remove(depfile_name_from(p)); + // keep .d files for now to speed dependencies detection on following runs + //fs::remove(depfile_name_from(p)); dependencies.emplace(p_obj, deps); } return dependencies; @@ -277,10 +278,9 @@ void Builder::clean() { if (fs::exists(i)) { commands.push_back(fmt::format("rm -f {}", i.string())); } - fs::path dep{i}; - dep.replace_extension("d"); - if (fs::exists(dep)) { - commands.push_back(fmt::format("rm -f {}", dep.string())); + fs::path depfile{depfile_name_from(i)}; + if (fs::exists(depfile)) { + commands.push_back(fmt::format("rm -f {}", depfile.string())); } } diff --git a/debian/README.Debian b/debian/README.Debian index 4da4a5b..cc7a1c9 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -1,7 +1,7 @@ -xmake for Debian +ymake for Debian ================ -This package is the Debian version of xmake. +This package is the Debian version of ymake. It is a build system with XML based config files. @@ -9,7 +9,7 @@ It is a build system with XML based config files. Usage ----- -Run "xmake" like "make" to build programs with an XMakefile. +Run "ymake" like "make" to build programs with an YMakefile. Contact diff --git a/debian/changelog b/debian/changelog index d94dedf..1af324c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -xmake (1.0) unstable; urgency=medium +ymake (1.0) unstable; urgency=medium * Initial release diff --git a/debian/control b/debian/control index c27819e..a54f393 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,14 @@ -Source: xmake +Source: ymake Section: devel Priority: optional Maintainer: Roland Reichwein <mail@reichwein.it> Build-Depends: debhelper (>= 12), libboost-all-dev | libboost1.71-all-dev, clang | g++-9, llvm | g++-9, lld | g++-9, pkg-config, libfmt-dev, googletest, gcovr, libreichwein-dev Standards-Version: 4.5.0 -Homepage: http://www.reichwein.it/xmake/ +Homepage: http://www.reichwein.it/ymake/ -Package: xmake +Package: ymake Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Homepage: http://www.reichwein.it/xmake/ +Homepage: http://www.reichwein.it/ymake/ Description: Buildsystem - XMake is a buildsystem with automatically resolved dependencies. + YMake is a buildsystem with automatically resolved dependencies. @@ -1,7 +1,7 @@ -#include "xmake.h" +#include "ymake.h" int main(int argc, char* argv[]) { - return xmake(argc, argv); + return ymake(argc, argv); } diff --git a/xmake.h b/xmake.h deleted file mode 100644 index 6c402cf..0000000 --- a/xmake.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -int xmake(int argc, char* argv[]); - @@ -1,4 +1,4 @@ -#include "xmake.h" +#include "ymake.h" #include "builder.h" @@ -30,20 +30,20 @@ namespace pt = boost::property_tree; using namespace std::string_literals; namespace { - const fs::path XMakefile{"XMakefile"}; + const fs::path YMakefile{"YMakefile"}; void usage() { - std::cout << "Usage: xmake <target>" << std::endl; + std::cout << "Usage: ymake <target>" << std::endl; } } -int xmake(int argc, char* argv[]) +int ymake(int argc, char* argv[]) { try { pt::ptree ptree; - pt::read_xml(XMakefile, ptree, pt::xml_parser::no_comments | pt::xml_parser::trim_whitespace); + pt::read_xml(YMakefile, ptree, pt::xml_parser::no_comments | pt::xml_parser::trim_whitespace); std::string action{"default"}; @@ -74,7 +74,7 @@ int xmake(int argc, char* argv[]) } } catch (const std::exception& ex) { - std::cerr << "xmake: " << ex.what() << std::endl; + std::cerr << "ymake: " << ex.what() << std::endl; return 1; } @@ -0,0 +1,4 @@ +#pragma once + +int ymake(int argc, char* argv[]); + |