fmake

make any project just by typing `fmake`
git clone git@getsh.org:fmake.git
Log | Files | Refs | README | LICENSE

config.h (3190B)


      1 #define X(BLEVEL, FTYPE, OTYPE, LOOKFOR, CMD, ...) \
      2           BLEVEL, FTYPE, OTYPE, LOOKFOR, CMD, { CMD, __VA_ARGS__}, \
      3           (sizeof((char*[]){"" __VA_ARGS__}) / sizeof(char**)) + 1
      4 
      5 const maker_config_t cmake_chain = { X(1, FM_FIL, 0, "CMakeCache.txt", "cmake", "--build", ".") };
      6 
      7 /*X(level type operation           lookup name         cmd               cmd args) opt chain */
      8 #define BUILD_SYSTEMS \
      9 { X(1, FM_FIL,               0     , "Makefile"       , "make")  },\
     10 { X(1, FM_FIL,               0     , "makefile"       , "make")  },\
     11 { X(1, FM_FIL,               0     , "GNUMakefile"    , "gmake")  },\
     12 { X(1, FM_FIL,               0     , "BSDMakefile"    , "bmake")  },\
     13 { X(1, FM_FIL,               0     , "Justfile"       , "just")  },\
     14 { X(1, FM_FIL,               0     , "OMakefile"      , "omake")  },\
     15 { X(1, FM_FIL,               0     , "make"           , "sh"               , "make")  },\
     16 { X(1, FM_FIL,               0     , "build.sh"       , "sh"               , "build.sh")  },\
     17 { X(1, FM_FIL,               0     , "Gruntfile"      , "grunt")  },\
     18 { X(1, FM_FIL,               0     , "build.ninja"    , "ninja")  },\
     19 { X(1, FM_FIL,               0     , "WORKSPACE"      , "bazel"            , "build")  },\
     20 { X(1, FM_FIL,               0     , "nob"            , "./nob")  },\
     21 { X(1, FM_FIL,               0     , "nob.c"          , "cc"               , "./nob.c"      , "-o"      , "nob")  },\
     22 { X(1, FM_FIL,               0     , "nobuild"        , "./nobuild"        , )  },\
     23 { X(1, FM_FIL,               0     , "nobuild.c"      , "cc"               , "./nobuild.c"  , "-o"      , "nobuild")  },\
     24 { X(1, FM_FIL,               0     , "packages.json"  , "npm"              , "install")  },\
     25 { X(1, FM_DIR,               0     , "node_modules"   , "npm"              , "run")  },\
     26 { X(1, FM_FIL,               0     , "Cargo.toml"     , "cargo"            , "build")  },\
     27 { X(1, FM_FIL,               0     , "setup.py"       , "pip"              , "install"      , ".")  },\
     28 { X(1, FM_FIL,               0     , "gradlew.bat"    , "cmd"              , "/c", "gradlew.bat")  },\
     29 { X(1, FM_FIL,               0     , "gradlew"        , "sh"               , "gradlew")  },\
     30 { X(1, FM_EXT,               0     , "*.pro"          , "qmake")  },\
     31 { X(1, FM_EXT,               0     , "*.sln"          , "msbuild")  },\
     32 { X(1, FM_EXT,               0     , "*.vcxproj"      , "msbuild")  },\
     33 { X(2, FM_FIL, FM_MKD | FM_CBB     , "configure"      , "sh"               , "../configure")  },\
     34 { X(2, FM_FIL, FM_CAB              , "CMakeLists.txt" , "cmake"            , "-Bout"), &cmake_chain  },\
     35 { X(2, FM_FIL, FM_CAB              , "BUILD.gn"       , "gn"               , "gen"          , "out/")  },\
     36 { X(3, FM_FIL,               0     , "configure.ac"   , "autoreconf"       , "-fiv")  },\
     37 { X(3, FM_FIL,               0   , "CMakePresets.json", "cmake"            , "--preset", "default")  },\
     38 { X(3, FM_FIL,               0     , "APKBUILD"       , "abuild"           , "-r")  },\
     39 { X(3, FM_FIL,               0     , "PKGBUILD"       , "makepkg"          , "-i")}
     40 
     41 static const maker_config_t makers[] = {
     42 BUILD_SYSTEMS
     43 };
     44 
     45 #undef BUILD_SYSTEMS
     46 #undef X