Package: bulgogi
bulgogi-py0.1.3The Python interface forbulgogi.MotiveRather than write a CLI from scratch, using a scripting languageas the interfaceseemed cool and appropriate for this project.Build configurations are slow-changing and repititious, making scripts ideal for the job.InstallationTo get started, install bulgogi using pip:pip install bulgogiOnce installed at the user-level, use it in your latest build project.Building from scratchIf your development platform is unlucky enough to be missing a compatible pre-built wheel distribution, the following instructions can be used to build the Python package from source.Build dependenciesThe following system dependencies are required:gitgccmakelibtoolpython3pipbuildpython3-develBuild instructionsOnce system dependencies are installed, install the package from the upstream git repository:pip install git+https://github.com/High-Intensity-Prototyping-Labs/bulgogi-py.gitThis should run and execute the build sequence required and install the system locally.Build troubleshootingIf errors are encountered during build, an attempt at a manual build would be best for debugging purposes.Clone thebulgogi-pyrepository and run thebuild.shscript on a UNIX-like system:git clone https://github.com/High-Intensity-Prototyping-Labs/bulgogi-py.git 

cd bulgogi-py 

./build.shWith a careful eye and enough experience, the verbose build output should yield useful information to troubleshoot issues.Usage1. Createsetup.pyFirst create thesetup.pyfile in the root of your build project and declare your project:# setup.pyimportbulgogiasbulbul.new_project('My Project')bul.set_version('v1.0.0')...2. Declare targetsThe next step is to declare targets based on your project layout:...target1=bul.add_target('target1',bul.LIB)execute=bul.add_target('execute',bul.EXE)...3. Declare relationsTargets need to be linked in some kind of way. This is usually referred to as 'dependency linking'.In the Python interface for bulgogi, dependencies are linked by target ID:...bul.add_target_dep(execute,target1)...4. Commit the setupLastly, the build configuration must be commit to disk before it can be built:...bul.commit()Putting it all together# setup.pyimportbulgogiasbulbul.new_project('My Project')bul.set_version('v1.0.0')target1=bul.add_target('target1',bul.LIB)execute=bul.add_target('execute',bul.EXE)bul.add_target_dep(execute,target1)bul.commit()This will generate aproject.yamlfile in the root of your directory and resemble something like:execute:-target1Usually configuration files are guarded from manual edits - but bulgogi in fact encourages the developer to modify theproject.yamlfile as they please.Where are all the sources?Although targets have been declared and dependencies linked, the best bulgogi can do to find the source files to copmile is to guess.As a sane default, it will guess that each target has a directory matching its name (target1/andexecute/in this case) and look forsrcandincdirectories within.This means - yes - that in theory thesetup.pyscript can be ommitted altogether. This is not defeatist - it's to highlight that the script is most useful to standardize project configuration for all bulgogi targets, even if the project isn't your own.Declaring sourcesIn thesetup.py, target sources can be declared:...bul.add_sources(target1,'target1/src/*.c')bul.add_headers(target1,'target1/inc/*.h')...bul.commit()This can be done anytimeaftertarget1has been added butbeforethe configuration is committed to disk.PatternsIt is evident that a specific files were not specified for the target sources. Patterns such as*.care used instead and are known as 'globbing'.GlobbingGlobbing is a mixed subject among build system afficionados. Bulgogi offers it as a built-in feature and allows users to decide how they would like to approach....# Adding individual files is allowed.bul.add_sources(target1,'target1/src/hello.c')bul.add_sources(target1,'target1/src/dog.c')bul.add_sources(target1,'target1/src/cat.c')...# Files can be 'globbed' by file-extension.bul.add_sources(target1,'target1/src/*.c')bul.add_sources(target1,'target1/src/*.cpp')...# Globbing can also be performed recursively.bul.add_headers(target1,'target1/inc/**.c')bul.commit()VariablesA benefit of using a feature-complete scripting language is the built-in availability of variables....targets=['target1','execute']src_dir='src'inc_dir='inc'fortargetintargets:bul.add_sources(target,bul.names(target)+'/'+SRC_DIR+'/*.c')bul.add_headers(target,bul.names(target)+'/'+INC_DIR+'/*.h')bul.commit()Licensebulgogi-pybyAlex Amellalis licensed underCC BY 4.0