Minor fixes + clean code + exclude hidden source file
This commit is contained in:
parent
15d7304baf
commit
2c9120752e
2 changed files with 3 additions and 5 deletions
3
make.py
3
make.py
|
|
@ -23,8 +23,7 @@ class Config:
|
||||||
COMPILE_FLAGS = f'-Wall -I{INCLUDE_DIR}' # Flags added for compiling (recommandation : `pkg-config --cflags`)
|
COMPILE_FLAGS = f'-Wall -I{INCLUDE_DIR}' # Flags added for compiling (recommandation : `pkg-config --cflags`)
|
||||||
LINK_FLAGS = '' # Flags added for linking (recommandation : `pkg-config --libs`)
|
LINK_FLAGS = '' # Flags added for linking (recommandation : `pkg-config --libs`)
|
||||||
|
|
||||||
CPP_HEADERS = INCLUDE_DIR.rglob('*.hpp')
|
CPP_SOURCES = [filepath for filepath in SOURCE_DIR.rglob('*.cpp') if not filepath.name.startswith('.')]
|
||||||
CPP_SOURCES = SOURCE_DIR.rglob('*.cpp')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
||||||
5
umake.py
5
umake.py
|
|
@ -26,7 +26,6 @@ class Config:
|
||||||
COMPILE_FLAGS = f'-Wall -I{INCLUDE_DIR}' # Flags added for compiling (recommandation : `pkg-config --cflags`)
|
COMPILE_FLAGS = f'-Wall -I{INCLUDE_DIR}' # Flags added for compiling (recommandation : `pkg-config --cflags`)
|
||||||
LINK_FLAGS = '' # Flags added for linking (recommandation : `pkg-config --libs`)
|
LINK_FLAGS = '' # Flags added for linking (recommandation : `pkg-config --libs`)
|
||||||
|
|
||||||
CPP_HEADERS = INCLUDE_DIR.rglob('*.hpp')
|
|
||||||
CPP_SOURCES = SOURCE_DIR.rglob('*.cpp')
|
CPP_SOURCES = SOURCE_DIR.rglob('*.cpp')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -89,7 +88,7 @@ def make(config: Config):
|
||||||
job = subprocess.run(cmd, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
job = subprocess.run(cmd, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
universal_newlines=True, shell=True)
|
universal_newlines=True, shell=True)
|
||||||
if job.returncode != 0:
|
if job.returncode != 0:
|
||||||
error_paths.append((source_path, job.stdout.read() + job.stderr.read()))
|
error_paths.append((source_path, job.stdout + job.stderr))
|
||||||
break
|
break
|
||||||
dependency_dict[str(source_path)] = job.stdout.split('.o: ')[1].replace('\n', '').replace('\\ ', '').split(' ')
|
dependency_dict[str(source_path)] = job.stdout.split('.o: ')[1].replace('\n', '').replace('\\ ', '').split(' ')
|
||||||
if error_paths:
|
if error_paths:
|
||||||
|
|
@ -120,7 +119,7 @@ def make(config: Config):
|
||||||
todo_list.append((source_path, cmd))
|
todo_list.append((source_path, cmd))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not todo_list:
|
if not todo_list and all([(config.BIN_DIR / app_path).exists() for app_path in config.APPS]):
|
||||||
print(ConsoleColor.GREEN + 'Nothing to do' + ConsoleColor.ENDCOLOR)
|
print(ConsoleColor.GREEN + 'Nothing to do' + ConsoleColor.ENDCOLOR)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue