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
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# Extras
|
||||
enigma
|
||||
dist/*
|
||||
|
|
19
Makefile
19
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
|
||||
|
|
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";
|
||||
|
||||
using namespace std;
|
||||
#include <iostream>
|
||||
#include "strings/strings.cpp"
|
||||
|
||||
int main() {
|
||||
cout << 'Hello World';
|
||||
std::cout << getString();
|
||||
return 0;
|
||||
}
|
Reference in a new issue