aboutsummaryrefslogtreecommitdiffstats
path: root/makefile
blob: 5cb27a546f1457c4ac308a6932aca7fe2d2497ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Your login. For example, mine is dt10. Yours
# won't be eie2ugs...
LOGIN ?= eie2ugs

# Turn on all warnings
CPPFLAGS += -W -Wall

# Add debug information
CPPFLAGS += -g

# Pick up any headers in the ./include directories
CPPFLAGS += -I include

# C++11 by default
CXXFLAGS += -std=c++11

DEFAULT_OBJECTS = \
	src/shared/mips_test_framework.o \
	src/shared/mips_mem_ram.o 

USER_CPU_SRCS = \
	$(wildcard src/$(LOGIN)/mips_cpu.cpp) \
	$(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) \
	$(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