diff --git a/src/.recall b/src/.recall index db634d263eea58e2eabf2b7558072494ce52c93a..43779ee29c6f793fc005424d83f3afd62c65011c 100755 --- a/src/.recall +++ b/src/.recall @@ -1,6 +1,5 @@ #!/bin/bash -if [ -d "temp" ]; then +if [ -d ".srcstore" ]; then rm -f *.cpp - cp temp/*.cpp . - rm -rf temp/ + cp .srcstore/*.cpp . fi diff --git a/src/.srcmv b/src/.srcmv new file mode 100755 index 0000000000000000000000000000000000000000..c50de1cb0eb79f384b7ec17fa58a32b38cbc8ae8 --- /dev/null +++ b/src/.srcmv @@ -0,0 +1,2 @@ +#!/bin/bash +for FILENAME in *.cpp; do mv $FILENAME src.$FILENAME; done diff --git a/src/makefile b/src/makefile index d0e4e3443dfd372e552939ff36a7511aaac5ff48..c58368a3c33c0f344746f99471400407bc430724 100644 --- a/src/makefile +++ b/src/makefile @@ -1,37 +1,51 @@ -source: *.cpp + +.PHONY: default clean recall link compile ready + +default: link + +ready: #Setting up... + @#Bring over the libtcod reqs @cp ./libtcod/*.so . - @rm -rf temp/ - @mkdir temp - @cp *.cpp temp/ + @#Copy to the srcstore + @rm -rf .srcstore/ + @mkdir .srcstore + @cp *.cpp .srcstore/ - @bash .hiddenmv + @#Rename to src.* + @bash .srcmv + @#Bring over the tests @cp test/*.cpp . +compile: ready + #Compiling... @g++ -g -c *.cpp -I./libtcod/include -L. -ltcod -ltcodxx -Wl,-rpath=. -Wall -std=c++11 + @# Remove *.cpp and bring back the old ones (could also just rename src.*.cpp -> *.cpp) + @rm -f *.cpp + @cp .srcstore/*.cpp . + +link: compile + #Linking source... - @g++ -g -o RogueReborn.exe zz.*.o *.so -I./libtcod/include -L. -ltcod -ltcodxx -Wl,-rpath=. -Wall -std=c++11 + @g++ -g -o RogueReborn.exe src.*.o *.so -I./libtcod/include -L. -ltcod -ltcodxx -Wl,-rpath=. -Wall -std=c++11 - @rm -f zz.main.o + @rm -f src.main.o #Linking tests... @g++ -g -o Test.exe *.o *.so -I./libtcod/include -L. -ltcod -ltcodxx -Wl,-rpath=. -Wall -std=c++11 - #Cleaning up... - @rm -f *.o *.cpp - @cp temp/*.cpp . + #Removing objects + @rm -f *.o + recall: @bash .recall clean: - @rm -f *.exe *.so *.o - @rm -f scores.txt - -default: source \ No newline at end of file + @rm -f *.exe *.so *.o scores.txt \ No newline at end of file diff --git a/src/test/armor.test.cpp b/src/test/test.armor.cpp similarity index 92% rename from src/test/armor.test.cpp rename to src/test/test.armor.cpp index 17ede42f24af0b3f5efb4e2a0b294e6f9cdc8a09..5c6742c57f6b798407e88c15ac0295ba8e415f38 100644 --- a/src/test/armor.test.cpp +++ b/src/test/test.armor.cpp @@ -7,7 +7,7 @@ #include <iostream> #include "include/armor.h" -#include "testable.test.cpp" +#include "test.testable.cpp" class ArmorTest : public Testable { public: diff --git a/src/test/main.test.cpp b/src/test/test.main.cpp similarity index 76% rename from src/test/main.test.cpp rename to src/test/test.main.cpp index ff085bfb038120457cd499266087d71c074e1d06..093b11fcf295fcbf97394ca929473bac8e14a1d0 100644 --- a/src/test/main.test.cpp +++ b/src/test/test.main.cpp @@ -5,8 +5,8 @@ #include <vector> #include <iostream> -#include "armor.test.cpp" -#include "testable.test.cpp" +#include "test.armor.cpp" +#include "test.testable.cpp" int main(){ diff --git a/src/test/testable.test.cpp b/src/test/test.testable.cpp similarity index 100% rename from src/test/testable.test.cpp rename to src/test/test.testable.cpp