Changeset 125 for trunk/Platforms/Test/Makefile
- Timestamp:
- Jun 17, 2009, 6:22:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platforms/Test/Makefile
r124 r125 43 43 ENTITY = Test 44 44 45 DIR_TMP= $(MORPHEO_TMP)46 DIR_INC= include47 DIR_SRC= src48 DIR_OBJ = $(DIR_TMP)/obj49 DIR_LIB = $(DIR_TMP)/lib50 DIR_BIN = $(DIR_TMP)/bin51 DIR_LOG = $(DIR_TMP)/log52 DIR_DATA = ./data53 DIR_LOGS = $(patsubst $(DIR_DATA)/%,$(DIR_LOG)/%,$(wildcard $(DIR_DATA)/*))54 55 DIR_SOFT = $(MORPHEO_TOPLEVEL)/Softwares45 PATH_TMP = $(MORPHEO_TMP) 46 PATH_INC = include 47 PATH_SRC = src 48 PATH_OBJ = $(PATH_TMP)/obj 49 PATH_LIB = $(PATH_TMP)/lib 50 PATH_BIN = $(PATH_TMP)/bin 51 PATH_LOG = $(PATH_TMP)/log 52 PATH_DATA = ./data 53 PATH_LOGS = $(patsubst $(PATH_DATA)/%,$(PATH_LOG)/%,$(wildcard $(PATH_DATA)/*)) 54 55 PATH_SOFT = $(MORPHEO_TOPLEVEL)/Softwares 56 56 57 57 #MORPHEO - define in $(MORPHEO_TOPLEVEL)/IPs/systemC/processor/Morpheo/Makefile.deps … … 71 71 #---------------------------------------------------------- 72 72 #---------------------------------------------------------- 73 SOURCES = $(wildcard $(DIR_SRC)/*.cpp) 74 OBJECTS = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(SOURCES)) 75 LOGS = $(patsubst $(DIR_DATA)/%.cfg,$(DIR_LOG)/%.log,$(wildcard $(DIR_DATA)/$(DATA)/*.cfg)) 76 EXEC = $(DIR_BIN)/soft.x 77 EXEC_PREFIX = $(NICE) -n $(PRIORITY) 78 #$(VALGRIND) 73 SOURCES = $(wildcard $(PATH_SRC)/*.cpp) 74 OBJECTS = $(patsubst $(PATH_SRC)/%.cpp,$(PATH_OBJ)/%.o,$(SOURCES)) 75 LOGS = $(patsubst $(PATH_DATA)/%.cfg,$(PATH_LOG)/%.log,$(wildcard $(PATH_DATA)/$(DATA)/*.cfg)) 76 EXEC = $(PATH_BIN)/soft.x 77 EXEC_PREFIX = $(NICE) -n $(PRIORITY) $(VALGRIND) 78 79 SCRIPT = make.sh 79 80 80 81 #-----[ Compilation ]-------------------------------------- … … 82 83 $(MORPHEO_INCDIR) \ 83 84 $(ENVIRONMENT_INCDIR) \ 84 -I$( DIR_INC)85 -I$(PATH_INC) 85 86 86 87 #LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR_SYSTEMC)) \ … … 89 90 90 91 LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR_SYSTEMC)) \ 91 -L$( DIR_LIB)92 -L$(PATH_LIB) 92 93 93 94 LIBNAME = $(ENVIRONMENT_LIBNAME) \ … … 106 107 #---------------------------------------------------------- 107 108 108 vpath %.h $( DIR_INC)109 vpath %.cpp $( DIR_SRC)110 vpath %.o $( DIR_OBJ)111 vpath %.cfg $( DIR_DATA)/*/112 113 .PRECIOUS : $( DIR_OBJ)/%.o $(DIR_BIN)/%.x $(DIR_LOG)/%.log109 vpath %.h $(PATH_INC) 110 vpath %.cpp $(PATH_SRC) 111 vpath %.o $(PATH_OBJ) 112 vpath %.cfg $(PATH_DATA)/*/ 113 114 .PRECIOUS : $(PATH_OBJ)/%.o $(PATH_BIN)/%.x $(PATH_LOG)/%.log 114 115 115 116 all : $(EXEC) 116 117 117 $( DIR_BIN)/%.x : $(DIR_OBJ) $(DIR_BIN)118 $(PATH_BIN)/%.x : $(PATH_OBJ) $(PATH_BIN) 118 119 @\ 119 120 $(ECHO) "Linkage : $*";\ … … 139 140 declare -i clean=$(CLEAN); \ 140 141 if $(TEST) $${clean} -ne 0 -a "$(DATA)" != "$(DATA_ALL)"; then \ 141 $(RM) $( DIR_LOG)/$(DATA); \142 $(RM) $(PATH_LOG)/$(DATA); \ 142 143 fi; \ 143 $(MAKE) $( DIR_LOGS); \144 $(MAKE) $(PATH_LOGS); \ 144 145 declare logs="$(LOGS)"; \ 145 146 $(MAKE) $${logs}; \ … … 171 172 $(MAKE) run DATA=bench; 172 173 173 $(DIR_LOG)/%.log : $(DIR_DATA)/%.cfg $(EXEC) 174 distexe : 175 @\ 176 $(RM) $(SCRIPT); \ 177 for log in $(LOGS); do \ 178 $(ECHO) -n "cd $(MORPHEO_TOPLEVEL); source environment.sh; cd -; path=\"${PWD}\"; " >> $(SCRIPT); \ 179 if $(TEST) $(CLEAN) -ne 0; then \ 180 $(ECHO) -n "$(RM) $${log}; " >> $(SCRIPT); \ 181 fi; \ 182 $(ECHO) "$(MAKE) -C "'$${path}'" $${log} PRIORITY=$(PRIORITY);" >> $(SCRIPT); \ 183 done 184 185 $(PATH_LOG)/%.log : $(PATH_DATA)/%.cfg $(EXEC) 174 186 @\ 175 187 file=$$($(BASENAME) $<); \ … … 202 214 soft : 203 215 @\ 204 $(MAKE) --directory=$( DIR_SOFT) --makefile=Makefile;216 $(MAKE) --directory=$(PATH_SOFT) --makefile=Makefile; 205 217 206 218 #-----[ Rules ]-------------------------------------------- 207 219 208 $( DIR_OBJ)/%.o : %.cpp220 $(PATH_OBJ)/%.o : %.cpp 209 221 @\ 210 222 $(ECHO) "Compilation : $*";\ 211 223 $(CXX) $(PLATFORMS_CXX_FLAGS) -c -o $@ $<; 212 224 213 $( DIR_OBJ) $(DIR_BIN) $(DIR_LOGS) :225 $(PATH_OBJ) $(PATH_BIN) $(PATH_LOGS) : 214 226 @\ 215 227 $(ECHO) "Create directory : $@";\ … … 222 234 $(ECHO) "Delete temporary files in directory $(PWD)";\ 223 235 $(RM) $(OBJECTS) $(EXEC) $(LOGS) \ 224 *~ $( DIR_SRC)/*~ $(DIR_INC)/*~ $(DIR_DATA)/*/*~ *.res *.txt\236 *~ $(PATH_SRC)/*~ $(PATH_INC)/*~ $(PATH_DATA)/*/*~ *.res *.txt\ 225 237 *core* \ 226 238 tty* \ … … 234 246 @\ 235 247 $(ECHO) "Delete generated files in directory $(PWD)";\ 236 $(RM) $( DIR_OBJ) $(DIR_BIN) $(DIR_LOG);\237 $(MAKE) --directory=$( DIR_SOFT) --makefile=Makefile clean_all; \248 $(RM) $(PATH_OBJ) $(PATH_BIN) $(PATH_LOG) $(SCRIPT);\ 249 $(MAKE) --directory=$(PATH_SOFT) --makefile=Makefile clean_all; \ 238 250 $(MAKE) --directory=$(ENVIRONMENT_DIR) --makefile=Makefile clean_all; \ 239 251 $(MAKE) --directory=$(MORPHEO_DIR) --makefile=Makefile clean_all; … … 246 258 $(ECHO) " * all (default rules) : create software";\ 247 259 $(ECHO) " * run : execute platforms with test configuration";\ 248 $(ECHO) " set DATA to select a specific directory in $( DIR_DATA) (default : all)";\260 $(ECHO) " set DATA to select a specific directory in $(PATH_DATA) (default : all)";\ 249 261 $(ECHO) " set PRIORITY to nice the execution (default : 0)";\ 250 262 $(ECHO) " set CLEAN to remove previous log (default : 0)";\ … … 253 265 $(ECHO) " * debug : cf 'make run DATA=debug'";\ 254 266 $(ECHO) " * bench : cf 'make run DATA=bench'";\ 267 $(ECHO) " * distexe : Generate an command file to distexe. It's as run command, but just generate an script with all make";\ 255 268 $(ECHO) " * lib : make library";\ 256 269 $(ECHO) " * soft : make software";\
Note: See TracChangeset
for help on using the changeset viewer.