diff --git a/.gitignore b/.gitignore index a9c7abd..8504bb4 100644 --- a/.gitignore +++ b/.gitignore @@ -52,5 +52,5 @@ Module.symvers Mkfile.old dkms.conf -# Ignore /bin directory -/bin +# Ignore /build directory from cmake +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4abb461 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.28.1) + +project(quantum-utils) + +add_library(quantum SHARED ./quantum/src/test.c) + +add_executable(test_stuff ./test_stuff/src/main.c) + +target_link_libraries(test_stuff quantum) +target_include_directories(test_stuff PUBLIC ./quantum/src/) diff --git a/build-all.sh b/build-all.sh deleted file mode 100755 index 04b478f..0000000 --- a/build-all.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Build script to build everything - -set echo on - -mkdir -p bin/ - -echo "Building all.." - -pushd quantum -source build.sh -popd - -ERRORLEVEL=$? -if [ $ERRORLEVEL -ne 0 ]; then - echo "Error:"$ERRORLEVEL && exit -fi - -pushd test_stuff -source build.sh -popd - -ERRORLEVEL=$? -if [ $ERRORLEVEL -ne 0 ]; then - echo "Error:"$ERRORLEVEL && exit -fi - -echo "All assemblies built successfully!!!!" diff --git a/clean-all.sh b/clean-all.sh deleted file mode 100755 index 7c2a394..0000000 --- a/clean-all.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Clean up paths if they exist -if [[ -d "./build/" ]]; then - rm -rf ./build -fi - -if [[ -d "./bin/" ]]; then - rm -rf ./bin -fi diff --git a/quantum/build.sh b/quantum/build.sh deleted file mode 100755 index 71e6562..0000000 --- a/quantum/build.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# Build script for quantum - -set echo on - -mkdir -p ../build/ - -# Get a list of all the .c files. -cFilenames=$(find . -type f -name "*.c") - -assembly="quantum" -objLocation="../build/libquantum.o" -compilerFlags="-g -c -fpic" -includeFlags="-Isrc" - -echo "Building $assembly..." - -# First we need to compile down to .o files -gcc $cFilenames $compilerFlags -o $objLocation $includeFlags - -compilerFlags="-g -shared" -gcc $objLocation $compilerFlags -o ../bin/libquantum.so $includeFlags diff --git a/test_stuff/build.sh b/test_stuff/build.sh deleted file mode 100755 index 6241524..0000000 --- a/test_stuff/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -#Build script for test_stuff - -set echo on - -# Get a list of all the .c files. -cFilenames=$(find . -type f -name "*.c") - -assembly="test_stuff" -compilerFlags="-g -fpic" -includeFlags="-Isrc -I../quantum/src/" -linkerFlags="-L../bin/ -lquantum -Wl,-rpath,." - -echo "Building $assembly..." -gcc $cFilenames $compilerFlags -o ../bin/$assembly $includeFlags $linkerFlags