Skip to content
Snippets Groups Projects
Commit 9173f51b authored by Ori Almog's avatar Ori Almog
Browse files

Things almost work in the makefile world

parent ef14b7ad
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
if [ -d "temp" ]; then if [ -d ".srcstore" ]; then
rm -f *.cpp rm -f *.cpp
cp temp/*.cpp . cp .srcstore/*.cpp .
rm -rf temp/
fi fi
#!/bin/bash
for FILENAME in *.cpp; do mv $FILENAME src.$FILENAME; done
source: *.cpp
.PHONY: default clean recall link compile ready
default: link
ready:
#Setting up... #Setting up...
@#Bring over the libtcod reqs
@cp ./libtcod/*.so . @cp ./libtcod/*.so .
@rm -rf temp/ @#Copy to the srcstore
@mkdir temp @rm -rf .srcstore/
@cp *.cpp temp/ @mkdir .srcstore
@cp *.cpp .srcstore/
@bash .hiddenmv @#Rename to src.*
@bash .srcmv
@#Bring over the tests
@cp test/*.cpp . @cp test/*.cpp .
compile: ready
#Compiling... #Compiling...
@g++ -g -c *.cpp -I./libtcod/include -L. -ltcod -ltcodxx -Wl,-rpath=. -Wall -std=c++11 @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... #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... #Linking tests...
@g++ -g -o Test.exe *.o *.so -I./libtcod/include -L. -ltcod -ltcodxx -Wl,-rpath=. -Wall -std=c++11 @g++ -g -o Test.exe *.o *.so -I./libtcod/include -L. -ltcod -ltcodxx -Wl,-rpath=. -Wall -std=c++11
#Cleaning up... #Removing objects
@rm -f *.o *.cpp @rm -f *.o
@cp temp/*.cpp .
recall: recall:
@bash .recall @bash .recall
clean: clean:
@rm -f *.exe *.so *.o @rm -f *.exe *.so *.o scores.txt
@rm -f scores.txt \ No newline at end of file
default: source
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <iostream> #include <iostream>
#include "include/armor.h" #include "include/armor.h"
#include "testable.test.cpp" #include "test.testable.cpp"
class ArmorTest : public Testable { class ArmorTest : public Testable {
public: public:
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include "armor.test.cpp" #include "test.armor.cpp"
#include "testable.test.cpp" #include "test.testable.cpp"
int main(){ int main(){
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment