aboutsummaryrefslogtreecommitdiffstats
path: root/makefile
diff options
context:
space:
mode:
authorDavid Thomas <m8pple@github.com>2016-10-10 06:27:37 +0100
committerDavid Thomas <m8pple@github.com>2016-10-10 06:27:37 +0100
commit0673cc3651b60203b90eccdc1c5af5e455f4b6fb (patch)
tree6c50f8b4387ebda2c647b8e7bd66d60884d1e557 /makefile
parent969874832d55c00c1c5874ef5ae1fdb82b3ded83 (diff)
downloadMipsCPU-0673cc3651b60203b90eccdc1c5af5e455f4b6fb.tar.gz
MipsCPU-0673cc3651b60203b90eccdc1c5af5e455f4b6fb.zip
Updated for 2016.
Diffstat (limited to 'makefile')
-rw-r--r--makefile51
1 files changed, 31 insertions, 20 deletions
diff --git a/makefile b/makefile
index d00ca10..2f38cb0 100644
--- a/makefile
+++ b/makefile
@@ -2,34 +2,45 @@
# won't be eie2ugs...
LOGIN ?= eie2ugs
-CPPFLAGS += -W -Wall -g
+# Turn on all warnings
+CPPFLAGS += -W -Wall
+
+# Add debug information
+CPPFLAGS += -g
+
+# Pick up any headers in the ./include directories
CPPFLAGS += -I include
-CFLAGS += -std=c99
+# C++11 by default
CXXFLAGS += -std=c++11
-# Force the inclusion of C++ standard libraries
-LDLIBS += -lstdc++
-
DEFAULT_OBJECTS = \
- src/shared/mips_test_framework.o \
- src/shared/mips_mem_ram.o
+ src/shared/mips_test_framework.o \
+ src/shared/mips_mem_ram.o
USER_CPU_SRCS = \
- $(wildcard src/$(LOGIN)/mips_cpu.c) \
- $(wildcard src/$(LOGIN)/mips_cpu.cpp) \
- $(wildcard src/$(LOGIN)/mips_cpu_*.c) \
- $(wildcard src/$(LOGIN)/mips_cpu_*.cpp) \
- $(wildcard src/$(LOGIN)/*/*.c) \
- $(wildcard src/$(LOGIN)/*/*.cpp) \
- $(wildcard src/$(LOGIN)/*/*.c) \
- $(wildcard src/$(LOGIN)/*/*.cpp)
-
-USER_CPU_OBJECTS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(USER_CPU_SRCS)))
-
-src/$(LOGIN)/test_mips : $(DEFAULT_OBJECTS) $(USER_CPU_OBJECTS)
+ $(wildcard src/$(LOGIN)/mips_cpu.cpp) \
+ $(wildcard src/$(LOGIN)/mips_cpu_*.cpp) \
+ $(wildcard src/$(LOGIN)/mips_cpu/*.cpp)
+
+USER_TEST_SRCS = \
+ $(wildcard src/$(LOGIN)/test_mips.cpp) \
+ $(wildcard src/$(LOGIN)/test_mips_*.cpp) \
+ $(wildcard src/$(LOGIN)/test_mips/*.cpp)
+
+USER_CPU_OBJECTS = $(patsubst %.cpp,%.o,$(USER_CPU_SRCS))
+USER_TEST_OBJECTS = $(patsubst %.cpp,%.o,$(USER_TEST_SRCS))
+
+src/$(LOGIN)/test_mips : $(DEFAULT_OBJECTS) $(USER_CPU_OBJECTS) $(USER_TEST_OBJECTS)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LFLAGS) $(LDLIBS)
+
fragments/run_fibonacci : $(DEFAULT_OBJECTS) $(USER_CPU_OBJECTS)
-
+
fragments/run_addu : $(DEFAULT_OBJECTS) $(USER_CPU_OBJECTS)
+clean :
+ -rm src/$(LOGIN)/test_mips
+ -rm $(DEFAULT_OBJECTS) $(USER_CPU_OBJECTS) $(USER_TEST_OBJECTS)
+
+all : src/$(LOGIN)/test_mips