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
Line 
1#
2# $Id: Makefile.Common 130 2009-06-30 12:31:46Z rosiere $
3#
4# [ Description ]
5#
6# Makefile
7#
8
9ifeq ($(origin MORPHEO_TOPLEVEL), undefined)
10        $(error "variable MORPHEO_TOPLEVEL is undefined");
11else
12        include                         $(MORPHEO_TOPLEVEL)/Makefile.tools
13endif
14ifeq ($(origin MORPHEO_PREFIX), undefined)
15        $(error "variable MORPHEO_PREFIX      is undefined");
16endif
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
26
27#-----[ Directory ]----------------------------------------
28DIR_TMP                         = $(MORPHEO_TMP)
29DIR_INC                         = include
30DIR_SRC                         = src
31DIR_OBJ                         = $(DIR_TMP)/obj
32DIR_LIB                         = $(MORPHEO_PREFIX)/lib
33DIR_SCRIPT                      = $(MORPHEO_SCRIPT)
34
35#-----[ Compilation ]--------------------------------------
36INCDIR                          = $(SYSTEMC_INCDIR_$(SIMULATOR_SYSTEMC))        \
37                                  -I.                                   \
38                                  -I$(DIR_MORPHEO)
39
40LIBDIR                          = -L$(DIR_LIB) \
41                                  $(SYSTEMC_LIBDIR_$(SIMULATOR_SYSTEMC))       
42#                                 $(OR1K_LIBDIR)                               
43
44FLAGS_COMMON                    = $(SYSTEMC_CFLAGS_$(SIMULATOR_SYSTEMC))        \
45                                  $(CXX_FLAGS)
46
47CFLAGS                          = $(MORPHEO_FLAGS) $(FLAGS_COMMON) $(INCDIR)
48LFLAGS                          = $(MORPHEO_FLAGS) $(FLAGS_COMMON) $(LIBDIR)
49
50#-----[ Variable ]-----------------------------------------
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)))))
54
55HEADERS                         = $(wildcard $(DIR_INC)/*.h)
56
57#-----[ Rules ]--------------------------------------------
58.PRECIOUS                       : $(DIR_OBJ)/$(ENTITY)_%.o
59
60test_env                        :
61                                @$(ECHO) "-------------------| $(ENTITY)"
62
63$(DIR_OBJ)/$(ENTITY)_%.o        : $(DIR_SRC)/%.cpp $(HEADERS)
64                                @\
65                                $(ECHO) "Compilation        : $*";\
66                                $(SYSTEMC_CXX_$(SIMULATOR_SYSTEMC)) $(CFLAGS) -c -o $@ $<;
67
68$(DIR_OBJ)                      :
69                                @\
70                                $(ECHO) "Create directory   : $@";\
71                                $(MKDIR) $@
72
73common_clean                    :
74                                @\
75                                $(ECHO) "Delete     temporary files in directory $(PWD)";\
76                                $(RM)   $(OBJECTS_COMMON)     \
77                                        *~                    \
78                                        $(DIR_SRC)/*~         \
79                                        $(DIR_INC)/*~;
80
81common_clean_all                : common_clean
82                                @\
83                                $(RM)   $(DIR_OBJ)
84
85common_help                     :
86                                @\
87                                $(ECHO) " -----[ Common ]-------------------------------------";\
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.