From 15d7304baf59479410d927f8a08e98e166a0e286 Mon Sep 17 00:00:00 2001 From: Corentin Date: Tue, 29 Jun 2021 13:28:44 +0900 Subject: [PATCH] Change README --- README.md | 15 ++++++++------- make.py | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7490a22..cc59fb2 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,13 @@ By default 3 targets can be used `make` (or `make all` as usual default of makef **Be careful** : `clean` will delete the object and binary output directories defined in `make.py`. +**Example :** from the root folder of a project : + +``` +git submodule add https://gitlab.com/corentin-pro/umake.git && cp umake/make* . +``` + + ## How it works ### Project layout @@ -35,19 +42,13 @@ By default 3 targets can be used `make` (or `make all` as usual default of makef µmake expects all the header and source files to be place in a directories specified in the configuration (in `make.py`). Object files and final binaries are outputed also in directories specified in the configuration but objects files in `debug` and `release` (default) are separated. -The separation of objects files is meant to switch mode quickly (only binaries are rebuilt). +The separation of object/release objects files is meant to avoid rebuilding the whole project after debugging a single file. To determine if a source file needs to be recompiled an hash is saved. The hashed are saved in a JSON file at the root of the object files directory (there are in fact 2 seperate files respectively in `debug` oand `release`). -If any header file changes every source files will be recompiled to avoid any issue (hence the small or medium-size project target for this tool). This could be address in the future if needed. - ### Caveats -* Header files dependencies is not implemented (any change triggers all compilation) - * Knowing python is recommended to understand the tool for any usage above configuration change. -* Targets management is not yet implemented (building all binaries), this can be easily address knowing python. A generic solution should be possible in the future. - * Template configuration is meant for C++ files (cpp/hpp) for now. diff --git a/make.py b/make.py index 72c1ded..c5d40fb 100644 --- a/make.py +++ b/make.py @@ -8,11 +8,11 @@ from umake import make class Config: CC = 'g++' # Compiler to call - APPS = ['app_name'] # Output binaries (need to be found as .cpp directly in SOURCE_DIR) + APPS = ['app_name'] # Output binaries (path to source without extension) IGNORE_APPS = [] JOB_COUNT = int(os.cpu_count() * 0.8) # Concurent jobs (multi-processing) - BIN_DIR = Path('bin') # Output directory (binaries) + BIN_DIR = Path('bin') # Output directory (binaries) INCLUDE_DIR = Path('include') # Include directory (header files) OBJECT_DIR = Path('obj') # Temporary directory (object files) SOURCE_DIR = Path('src') # Source directories