Got building up and running
This commit is contained in:
parent
afd8f51139
commit
e6b8cf66e9
4 changed files with 22 additions and 13 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -26,3 +26,7 @@
|
||||||
*.exe
|
*.exe
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
# Extras
|
||||||
|
enigma
|
||||||
|
dist/*
|
||||||
|
|
19
Makefile
19
Makefile
|
@ -1,18 +1,19 @@
|
||||||
LIBS = src/libs/*
|
BUILD_ARGS = -Wall -Werror -Isrc/libs/
|
||||||
BUILD_ARGS = -Wall -Werror -Ilibs/
|
|
||||||
|
|
||||||
|
|
||||||
build: libraries
|
build: libraries
|
||||||
g++ src/main.cpp -Ldist/* -Ilibs/ -o enigma
|
g++ src/main.cpp -Ldist/* $(BUILD_ARGS) -o enigma
|
||||||
|
|
||||||
|
|
||||||
libraries:
|
libraries:
|
||||||
mkdir dist/
|
mkdir -p dist/
|
||||||
for dir in $(LIBS); do \
|
for dir in src/libs/*; do\
|
||||||
|
echo "cd into" $$dir; \
|
||||||
cd $$dir; \
|
cd $$dir; \
|
||||||
g++ -c *.c -I../;\
|
g++ -c *.cpp ; \
|
||||||
mv *.o ../../dist; \
|
mv *.o ../../../dist/ ; \
|
||||||
cd -;
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf dist/
|
rm -rf dist/ enigma
|
||||||
|
|
5
src/libs/strings/strings.cpp
Normal file
5
src/libs/strings/strings.cpp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
std::string getString() {
|
||||||
|
return "Hello World";
|
||||||
|
}
|
|
@ -1,8 +1,7 @@
|
||||||
#include "iostream";
|
#include <iostream>
|
||||||
|
#include "strings/strings.cpp"
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
cout << 'Hello World';
|
std::cout << getString();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Reference in a new issue