Python Makefile Tool
Project description
pymaketool
pymaketool is an elegant and simple tool to build and manager large C/C++ projects and libraries. The main purpose is to ease the build process of a project using Python for find and organize file sources.
pymaketool process modules of code like objects. These objects ware define by files *_mk.py. With Python you can code how to discover and get source files and include paths, e.g.:
# File app_mk.py
from pymakelib import module
@module.ModuleClass
class App(module.AbstractModule):
def getSrcs(self):
# Get all sources .c in current folder ./app/
# return [ 'app/app.c' ]
return self.getAllSrcsC()
def getIncs(self):
# Get all include paths in current folder ./app/
# return [ 'app/app.c' ]
return self.getAllIncsC()
The file app_mk.py could be more short and ease, e.g.:
# File app_mk.py
from pymakelib import module
# BasicCModule inherits from AbstractModule and implement getSrcs and getIncs.
@module.ModuleClass
class App(module.BasicCModule):
pass
The file app_mk.py in raw style:
# File app_mk.py
from pymakelib import module
@module.ModuleClass
class App():
def getSrcs(self):
return [
'app/app.c'
]
def getIncs(self):
return [
'app'
]
Remote modules could be load like static libraries and with special compiler flags. e.g:
# File extlib_mk.py
from pymakelib import module
@module.ModuleClass
class ExtLib(module.ExternalModule):
def init(self):
# Compile modulelib like static library (Optional)
return module.StaticLibrary("modulelib", "Release", rebuild=True)
def getModulePath(self)->str:
# Location of module
return '/LIBS/module_lib/module_lib_mk.py'
def getCompilerOpts(self):
# Override method and set speacial compiler flags (Optional)
opts = project.getCompilerOpts()
opts['CONTROL-C-OPTS'] = ['-std=c99']
return opts
For more documentation go to Read the Docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymaketool-2.0.1.tar.gz
(33.1 kB
view hashes)
Built Distribution
pymaketool-2.0.1-py3-none-any.whl
(51.5 kB
view hashes)
Close
Hashes for pymaketool-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d9af749cac62f422a4fcec762a1eab5e2102d909f4c214590efe4a5b13e5d7f |
|
MD5 | 6731dbac226d0635a5627b5c1dfb3be0 |
|
BLAKE2b-256 | c3bb030adc9035fab4fb200a9d1a30968589686de3e791635839baad482ff998 |