#
# Accurate DRAM Model (ADM) test program makefile
# Author: Nan Li and Yi Wang, KTH
#

# IMPORTANT #
#   Change the following paths to the correct 
# locations (without the ending "/"). The paths
# should be the top directories of the packages,
# without the "include" sub-directories.

SYSC = D:/cygwin/lib/systemc-2.2.0
TLM = D:/cygwin/lib/TLM-2009-07-15
OCPIP = D:/cygwin/lib/ocpip
ADM = .
SYSC_LIB = D:/cygwin/lib

####

CC = g++
CFLAGS = -DSC_INCLUDE_DYNAMIC_PROCESSES -O3 -Wall -c
INCLUDES = -I$(SYSC)/include -I$(TLM)/include/tlm -I$(OCPIP)/include -I$(ADM)/include
LIBS = -L$(SYSC_LIB) -lsystemc
TEST_SRC = test/main.cpp test/sampdram.cpp test/test_gen.cpp
OBJECTS = $(TEST_SRC:.cpp=.o)
EXECUTABLE = adm_test

default: test
	
test: $(TEST_SRC) $(EXECUTABLE)
	
$(EXECUTABLE): $(OBJECTS) 
	$(CC) -o $@ $(OBJECTS) $(LIBS) 

.cpp.o:
	$(CC) $(INCLUDES) $(CFLAGS) $< -o $@

run_test: _force
	./$(EXECUTABLE) params/ocpParams params/admParams test/test_files/test_mt.txt test/test_mt_prio.csv mt prio

clean:
	@rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE).exe

test_file_gen: test/test_file_gen/test_file_gen.cpp
	$(CC) -o test/test_file_gen/test_file_gen -O3 -Wall test/test_file_gen/test_file_gen.cpp

_force:
