Skip to content

Commit 95557b5

Browse files
committed
Altered Makefiles to get Paul's tests to run
1 parent ab156b4 commit 95557b5

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ warsofcatan
1818
*.d
1919
*.test
2020
/Default
21+
*.wocs

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export SRC_HOME := $(realpath src)
33
export INCL_HOME := $(realpath include)
44
export TEST_LINK_FILES := $(realpath UnitTest++/libUnitTest++.a)
55
export TEST_INCLUDE := $(realpath UnitTest++/src)
6-
EXECUTABLE := warsofcatan
6+
export EXECUTABLE := warsofcatan
77
ALLFILES := $(wildcard $(SRC_HOME)/*) $(wildcard $(INCL_HOME)/*)
88
export CXX := g++
99
export LD := g++

tests/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
TEST_FILE := main.test
22

3+
OBJECTS := $(wildcard $(OBJ_HOME)/*.o)
4+
OBJECTS_NO_MAIN := $(subst $(OBJ_HOME)/main.o,,$(OBJECTS))
5+
36
.PHONY: run
47
run: $(TEST_FILE)
58
./$(TEST_FILE)
69

7-
$(TEST_FILE): ../$(LIBRARY) $(TEST_LINK_FILES)
8-
$(CXX) $(CXXFLAGS) -I$(TEST_INCLUDE) $(wildcard *.cpp) -o $@ $(TEST_LINK_FILES)
10+
$(TEST_FILE): ../$(EXECUTABLE) $(TEST_LINK_FILES)
11+
$(CXX) $(CXXFLAGS) -I$(TEST_INCLUDE) $(wildcard *.cpp) -o $@ $(TEST_LINK_FILES) $(OBJECTS_NO_MAIN) $(LDFLAGS)
912

1013
.PHONY: clean
1114
clean:

0 commit comments

Comments
 (0)