include $(MORPHEO_TOPLEVEL)/Makefile.tools include $(MORPHEO_TOPLEVEL)/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags #-----[ Directory ]---------------------------------------- DIR_TST = selftest DIR_INC = include DIR_SRC = src DIR_OBJ = obj DIR_BIN = bin #-----[ Compilation ]-------------------------------------- INCDIR = $(SYSTEMC_INCDIR_$(SIMULATOR)) \ -I$(DIR_INC) \ -I../processor/Morpheo LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR)) LIBNAME = $(SYSTEMC_LIBNAME_$(SIMULATOR)) \ -lbfd FLAGS = $(SYSTEMC_CFLAGS_$(SIMULATOR)) MORPHEO_CC_FLAGS = $(MORPHEO_FLAGS) $(CC_FLAGS) $(INCDIR) MORPHEO_CXX_FLAGS = $(MORPHEO_FLAGS) $(CXX_FLAGS) $(FLAGS) $(INCDIR) MORPHEO_L_FLAGS = $(MORPHEO_FLAGS) $(CXX_FLAGS) $(FLAGS) $(LIBDIR) #-----[ Variable ]----------------------------------------- ENTITY = `$(BASENAME) $$PWD` OBJECTS = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.cpp)) \ $(patsubst $(DIR_SRC)/%.c,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.c)) OBJECTS_BIN = $(patsubst $(DIR_TST)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_TST)/*.cpp)) HEADERS = $(wildcard $(DIR_INC)/*.h) EXE = $(DIR_BIN)/soft.x EXEC_PREFIX = #$(VALGRIND) #-----[ Rules ]-------------------------------------------- .PRECIOUS : $(DIR_OBJ)/%.o $(DIR_BIN)/%.x test_env : @\ $(ECHO) "-------------------| $(ENTITY)" $(DIR_OBJ)/%.o : $(DIR_SRC)/%.cpp $(HEADERS) @\ $(ECHO) "Compilation : $*";\ $(CXX) $(MORPHEO_CXX_FLAGS) -c -o $@ $<; $(DIR_OBJ)/%.o : $(DIR_SRC)/%.c $(HEADERS) @\ $(ECHO) "Compilation : $*";\ $(CC) $(MORPHEO_CC_FLAGS) -c -o $@ $<; $(DIR_OBJ)/%.o : $(DIR_TST)/%.cpp $(HEADERS) @\ $(ECHO) "Compilation : $*";\ $(CXX) $(MORPHEO_CXX_FLAGS) -c -o $@ $<; $(DIR_BIN)/%.x : $(OBJECTS_DEPS) $(OBJECTS) $(OBJECTS_BIN) \ $(ECHO) "Compilation : $*";\ $(CXX) $(MORPHEO_L_FLAGS) -o $@ $^ $(LIBNAME); $(DIR_OBJ) : @\ $(ECHO) "Create directory : $@";\ $(MKDIR) $@ $(DIR_BIN) : @\ $(ECHO) "Create directory : $@";\ $(MKDIR) $@ exe : all @\ export SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(EXEC_PREFIX) ./$(EXE) $(SYSTEMC_EXEC_PARAMS_$(SIMULATOR)) all_environment : test_env $(DIR_OBJ) $(DIR_BIN) @\ $(MAKE) $(EXE) environment_clean : @\ $(ECHO) "Delete temporary files in directory "$(PWD);\ $(RM) *~ \ $(DIR_OBJ) \ $(DIR_BIN) \ $(DIR_TST)/*~ \ $(DIR_SRC)/*~ \ $(DIR_INC)/*~ \ *.dot \ *.txt; environment_help : @\ $(ECHO) " -----[ Environment ]------------------------------";\ $(ECHO) "";\ $(ECHO) " * test_env : test if environnment's variable is set";\ $(ECHO) " * all_environment : generate object";\ $(ECHO) "";