# Make file for mips_v2.1

SIMDIR = /opt/HASE-III/bin/HEngine/
# i.e. gflag can be set to -g when calling make: makefile gflag=-g
HASELIB = -L/opt/HASE-III/bin/HEngine/lib -larray -lsync
SIMLIBS = -L$(SIMDIR)lib -lsim -lm 
INCLUDE = $(SIMDIR) -I/opt/HASE-III/bin/HEngine/include
LIB = 
EXEC = mips_v2.1_hase

default: $(EXEC)
OBJS = mips_v2.1.o scoreboard.o pipe_disp.o registers.o memory.o instr_fetch.o instr_decode.o Int_exe.o Flt_exe.o Mul_exe.o Div_exe.o mem_access.o write_back.o

%.o :%.c
	$(CXX) -c $(CXXFLAGS) -I$(INCLUDE) $< -o $@

%.o :%.cpp
	$(CXX) -c $(CXXFLAGS) -I$(INCLUDE) $< -o $@

$(EXEC): $(OBJS)
	$(CXX) $(CXXFLAGS) -I$(INCLUDE) -o $(EXEC) $(OBJS) $(SIMLIBS) $(HASELIB) $(LIB)

run:
	./$(EXEC)

clean:
	rm -f $(OBJS)
all: clean $(EXEC)
