Package: akbs
AKBS: TheAllKnowingBuildSystem for C, C++ and AssemblyRequirementsPython 3>=Installation# Linuxpython3-mpipinstallakbs# Windows (UNSUPPORTED!)python-mpipinstallakbs# Usagepython3-makbsSpeedTo test the build system, I made a build script forbasic_math_operations,Operating System: Debian BullseyeHost: Linux 5.10.102.1-microsoft-standard-WSL2Architecture: x86_64AKBS:
Version: 1.0.5
Time: 1.351sCMake w/ Makefile:
CMake Version: 3.26.0
Make Version: 4.3
Time: 3.360sCMake w/ Ninja:
CMake Version: 3.26.0
Ninja Version: 1.11.1
Time: 2.750sThebuild.akbsfile is as followsset(C_STD, 17)
set(CXX_STD, 17)
set(FILES, wildcard$(src/library/**/*.cpp) wildcard$(src/library/**/*.c))
set(OUTPUT_DIR, dist)
set(BUILD_DIR, build)

if(eq$($PLATFORM, POSIX))
set(FILES, wildcard$(src/library/linux/*.asm) remove$($FILES, src/library/cross-platform/addp.c, src/library/cross-platform/multiply_whole.c))
endif

check_for(C, CXX, ASM_INTEL, SHARED, STATIC)

set(OUTPUT, libbasic_math_operations.so)
compile(SHARED, $FILES)
set(OUTPUT, libbasic_math_operations.a)
compile(STATIC, $FILES)Note:Theremove$()helper function is used because themultiply_wholeandaddpfunctions are already present in Assembly for Linux, not for WindowsHow do you use AKBS?By default, the build script is calledbuild.akbs, similar toMakefileandCMakeLists.txtHowever, you can use the--fileoption to specify a fileTo enable languages, you use thecheck_forfunctioncheck_for(C, CXX, ASM_INTEL, ASM_ATT, STATIC, SHARED)Right now, only these 4 languages (and a static and shared library linker) (3 if you count AT&T and Intel syntax Assembly as one language) are supportedIf you want to set the standard of C and C++, set the C_STD or CXX_STD variableset(C_STD, 17)
set(CXX_STD, 17)To compile a list of files, use the compile functioncompile(SHARED/STATIC, src/a.c src/b.c src/c.c)To print a statement you can use the print function and to exit a program, use exitprint($PLATFORM)
exit(1)To use a variable, use$VARIABLENAMEThe$PLATFORMvariable comes predefined and is set toos.nameFor conditions, use if (else and else if are not implemented yet) and endif.if(set$(PLATFORM))
print($PLATFORM)
if(eq$($PLATFORM, UNIX))
print Yay, we're in UNIX land
endif
endifAlso, there is a rudimentary pre-processor, with%define%define ifend endif
if(set$(PLATFORM))
ifendComments work by adding a semi-colon at the start of the line; these   
; lines   
; will    
; be      
; skippedComments only work from the start of the lineThere is also a list of helper functionsFunction NameArgumentsDescriptionIntroducedwildcard$str1Evaluates a list of space separated globs into a space separated list of filesv1.0.0remove$str1, str2, str3...Removes str2 onwards from a space separated list of stringsv1.0.0replace$str1, str2, str3...Replaces str2,4,6,8... with str3,5,7,9... in str1v1.0.3eq$arg1, arg2Checks if two strings are equalv1.0.0neq$arg1, arg2Checks if two strings are unequalv1.0.3gt$arg1, arg2Checks if arg1 is greater than arg2v1.0.3lt$arg1, arg2Checks if arg1 is lesser than arg2v1.0.3gte$arg1, arg2Checks if arg1 is greater than or equal to arg2v1.0.3lte$arg1, arg2Checks if arg1 is lesser than or equal to arg2v1.0.3set$arg1Checks if there is a variable with the name arg1notset$arg1Checks if there is not a variable with the name arg1v1.0.3and$arg1, arg2, arg3...Ands all the booleansv1.0.4or$arg1, arg2, arg3...Ors all the booleansv1.0.4not$arg1Nots the booleanv1.0.4A list of important variables areVariableIs SetDescriptionIntroducedPLATFORMYesEquivalent ofos.namev1.0.0C_COMPILERNoC compiler location set bycheck_forv1.0.0CXX_COMPILERNoC++ compiler location set bycheck_forv1.0.0ASM_INTEL_COMPILERNoIntel Assembly assembler location set bycheck_forv1.0.0ASM_ATT_COMPILERNoAT&T Assembly assembler location set bycheck_forv1.0.0SHARED_COMPILERNoLinker location for shared libraries set bycheck_forv1.0.0STATIC_COMPILERNoLinker location for static libraries set bycheck_forv1.0.2OUTPUTNoOutput file generated by linkingv1.0.0C_STDNoThe C std used (just the number like 17, 11, etc.)v1.0.0CXX_STDNoThe C++ std used (just the number like 17, 11, etc.)v1.0.0BUILD_DIRNoThe directory to build the objects inv1.0.1OUTPUT_DIRNoThe directory to output the finished objects in inv1.0.1C_FLAGSNoFlags passed to C compilerv1.0.2CXX_FLAGSNoFlags passed to C++ compilerv1.0.2ASM_INTEL_FLAGSNoFlags passed to Intel Assembly assemblerv1.0.2ASM_ATT_FLAGSNoFlags passed to AT&T Assembly assemblerv1.0.2SHARED_FLAGSNoFlags passed to shared library linkerv1.0.2STATIC_FLAGSNoFlags passed to static library linkerv1.0.2How to clean the filespython3-makbs--cleanTo-DoBuild directory (milestone 1.0.1)Nested functionsWindows supportOptimizationSubdirectoriesAbility to set compilers fromset()and environment variablesMore if conditionsreplace$()helper function--clean commandDocumenting my code + Readable variablesC_FLAGS, CXX_FLAGS, ASM...Cache install locations (milestone 1.0.2)Ability to set target architecture (Use CFLAGS and CXXFLAGS)Plugin SupportMakeprintandexita function, not a statementMake comments work in the middle of a line