diff --git a/.gitignore b/.gitignore index b8bd026..a75b95b 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,7 @@ *.exe *.out *.app + +# Extras +enigma +dist/* diff --git a/Makefile b/Makefile index bca675b..fc9f503 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,19 @@ -LIBS = src/libs/* -BUILD_ARGS = -Wall -Werror -Ilibs/ +BUILD_ARGS = -Wall -Werror -Isrc/libs/ build: libraries - g++ src/main.cpp -Ldist/* -Ilibs/ -o enigma + g++ src/main.cpp -Ldist/* $(BUILD_ARGS) -o enigma + libraries: - mkdir dist/ - for dir in $(LIBS); do \ + mkdir -p dist/ + for dir in src/libs/*; do\ + echo "cd into" $$dir; \ cd $$dir; \ - g++ -c *.c -I../;\ - mv *.o ../../dist; \ - cd -; + g++ -c *.cpp ; \ + mv *.o ../../../dist/ ; \ done + clean: - rm -rf dist/ + rm -rf dist/ enigma diff --git a/src/libs/strings/strings.cpp b/src/libs/strings/strings.cpp new file mode 100644 index 0000000..d8722e0 --- /dev/null +++ b/src/libs/strings/strings.cpp @@ -0,0 +1,5 @@ +#include + +std::string getString() { + return "Hello World"; +} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 631552f..33fda9e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,7 @@ -#include "iostream"; - -using namespace std; +#include +#include "strings/strings.cpp" int main() { - cout << 'Hello World'; + std::cout << getString(); return 0; } \ No newline at end of file