source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common @ 130

Last change on this file since 130 was 130, checked in by rosiere, 15 years ago

1) add MORPHEO_PREFIX

  • Property svn:keywords set to Id
File size: 2.5 KB
RevLine 
[2]1#
2# $Id: Makefile.Common 130 2009-06-30 12:31:46Z rosiere $
3#
[83]4# [ Description ]
[2]5#
6# Makefile
7#
8
[88]9ifeq ($(origin MORPHEO_TOPLEVEL), undefined)
10        $(error "variable MORPHEO_TOPLEVEL is undefined");
11else
12        include                         $(MORPHEO_TOPLEVEL)/Makefile.tools
13endif
[130]14ifeq ($(origin MORPHEO_PREFIX), undefined)
15        $(error "variable MORPHEO_PREFIX      is undefined");
16endif
[88]17ifeq ($(origin MORPHEO_TMP), undefined)
18        $(error "variable MORPHEO_TMP      is undefined");
19endif
20ifeq ($(origin MORPHEO_SCRIPT), undefined)
21        $(error "variable MORPHEO_SCRIPT   is undefined");
22endif
23ifeq ($(origin DIR_MORPHEO), undefined)
24        $(error "variable DIR_MORPHEO      is undefined");
25endif
[15]26
[53]27#-----[ Directory ]----------------------------------------
[88]28DIR_TMP                         = $(MORPHEO_TMP)
[2]29DIR_INC                         = include
30DIR_SRC                         = src
[113]31DIR_OBJ                         = $(DIR_TMP)/obj
[130]32DIR_LIB                         = $(MORPHEO_PREFIX)/lib
[15]33DIR_SCRIPT                      = $(MORPHEO_SCRIPT)
[2]34
[53]35#-----[ Compilation ]--------------------------------------
[117]36INCDIR                          = $(SYSTEMC_INCDIR_$(SIMULATOR_SYSTEMC))        \
[85]37                                  -I.                                   \
[2]38                                  -I$(DIR_MORPHEO)
39
[113]40LIBDIR                          = -L$(DIR_LIB) \
[117]41                                  $(SYSTEMC_LIBDIR_$(SIMULATOR_SYSTEMC))       
[62]42#                                 $(OR1K_LIBDIR)                               
[2]43
[117]44FLAGS_COMMON                    = $(SYSTEMC_CFLAGS_$(SIMULATOR_SYSTEMC))        \
[78]45                                  $(CXX_FLAGS)
[15]46
[55]47CFLAGS                          = $(MORPHEO_FLAGS) $(FLAGS_COMMON) $(INCDIR)
48LFLAGS                          = $(MORPHEO_FLAGS) $(FLAGS_COMMON) $(LIBDIR)
[2]49
[53]50#-----[ Variable ]-----------------------------------------
[113]51#OBJECTS_COMMON                 = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.cpp))
52SOURCES                         = $(wildcard $(DIR_SRC)/*.cpp)
53OBJECTS_COMMON                  = $(addprefix $(DIR_OBJ)/$(ENTITY)_, $(addsuffix .o, $(basename $(notdir $(SOURCES)))))
[2]54
55HEADERS                         = $(wildcard $(DIR_INC)/*.h)
56
[53]57#-----[ Rules ]--------------------------------------------
[113]58.PRECIOUS                       : $(DIR_OBJ)/$(ENTITY)_%.o
[2]59
60test_env                        :
[83]61                                @$(ECHO) "-------------------| $(ENTITY)"
[2]62
[113]63$(DIR_OBJ)/$(ENTITY)_%.o        : $(DIR_SRC)/%.cpp $(HEADERS)
[48]64                                @\
65                                $(ECHO) "Compilation        : $*";\
[117]66                                $(SYSTEMC_CXX_$(SIMULATOR_SYSTEMC)) $(CFLAGS) -c -o $@ $<;
[2]67
68$(DIR_OBJ)                      :
[48]69                                @\
70                                $(ECHO) "Create directory   : $@";\
71                                $(MKDIR) $@
[2]72
73common_clean                    :
[48]74                                @\
[83]75                                $(ECHO) "Delete     temporary files in directory $(PWD)";\
[113]76                                $(RM)   $(OBJECTS_COMMON)     \
77                                        *~                    \
78                                        $(DIR_SRC)/*~         \
[48]79                                        $(DIR_INC)/*~;
[2]80
[88]81common_clean_all                : common_clean
[113]82                                @\
83                                $(RM)   $(DIR_OBJ)
[88]84
[2]85common_help                     :
[48]86                                @\
[53]87                                $(ECHO) " -----[ Common ]-------------------------------------";\
[48]88                                $(ECHO) "";\
89                                $(ECHO) " * test_env             : test if environnment's variable is set";\
90                                $(ECHO) "";
Note: See TracBrowser for help on using the repository browser.