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

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 3.2 KB
Line 
1#
2# $Id$
3#
4# [ Description ]
5#
6# Makefile
7#
8
9#-----[ Directory ]----------------------------------------
10DIR_INC                         = include
11DIR_SRC                         = src
12DIR_OBJ                         = obj
13DIR_SCRIPT                      = $(DIR_MORPHEO)/Script
14
15#-----[ Commands ]-----------------------------------------
16ECHO                            = echo
17EXPORT                          = export
18MKDIR                           = mkdir -p
19TEST                            = test
20READ                            = read
21DATE                            = date +%Y%m%d-%H%M%S
22CD                              = cd
23CP                              = cp
24CAT                             = cat
25LS                              = ls
26RM                              = rm -fr
27PWD                             = `pwd`
28MAKE                            = make -s
29AR                              = ar -v
30RANLIB                          = ranlib
31BASENAME                        = basename
32GREP                            = grep
33GREP_NOT                        = egrep -v
34TR                              = tr
35UPPERtoLOWER                    = $(TR) [:lower:] [:upper:]
36#-----[ Compilation ]--------------------------------------
37
38SYSTEMC_systemc                 = $(TOOLS)/systemc
39SYSTEMC_systemcass              = $(TOOLS)/systemcass
40SYSTEMC_systemcass_deps         = $(SYSTEMC_systemcass)
41
42SYSTEMC                         = $(SYSTEMC_$(SIMULATOR))
43
44INCDIR                          = -I$(SYSTEMC)/include  \
45                                  -I$(DIR_MORPHEO)
46
47DIRLIB_systemc                  = lib-$(TARGET_ARCH)   
48DIRLIB_systemcass               = lib
49DIRLIB_systemcass_deps          = $(DIRLIB_systemcass)
50
51LIBDIR                          = $(DIR_LIBRARY)                        \
52                                  -L$(SYSTEMC)/$(DIRLIB_$(SIMULATOR))   \
53                                  -L$(TOOLS)/soclib/lib                 \
54                                  -L$(TOOLS)/or1k/lib                           
55
56LIBS                            = $(LIBRARY) -lm -lsystemc -lsoclib -lbfd -liberty -ldl
57# target architecture
58TARGET_ARCH                     = linux
59
60XX_systemc                      =
61XX_systemcass                   = -rdynamic                             \
62                                  -ansi                                 \
63                                  -Wno-long-long                        \
64                                  -DCHECK_MULTIWRITING2REGISTER
65
66#                                  -DNONAME_RENAME
67
68XX_systemcass_deps              = $(XX_systemcass)
69
70EXEC_PARAMS_systemc             =
71EXEC_PARAMS_systemcass          =
72EXEC_PARAMS_systemcass_deps     = --p
73
74
75XX_COMMON                       = -O3                                   \
76                                  -g3                                   \
77                                  -Wall                                 \
78                                  -Wunused
79#                                 -Wno-deprecated                       \
80#                                 -Wno-non-template-friend              \
81#                                 -Wno-pmf-conversions                  \
82#                                 -Wfatal-errors                        \
83#                                 -pedantic                             \
84#                                 -Werror                               \
85
86XX_OPT                          = $(XX_COMMON) $(XX_$(SIMULATOR))
87
88CXX                             = export LANG=C; g++
89CXX_OPT                         = $(XX_OPT) $(FLAGS) $(INCDIR)
90LXX_OPT                         = $(XX_OPT) $(FLAGS) $(LIBDIR)
91
92EXEC_PARAMS                     = $(EXEC_PARAMS_$(SIMULATOR))
93
94#-----[ Variable ]-----------------------------------------
95
96ENTITY                          = `$(BASENAME) $$PWD`
97
98OBJECTS_COMMON                  = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.cpp))
99
100HEADERS                         = $(wildcard $(DIR_INC)/*.h)
101
102#-----[ Rules ]--------------------------------------------
103.PRECIOUS                       : $(DIR_OBJ)/%.o
104
105test_env                        :
106                                @$(ECHO) "-------------------[ $(ENTITY) ]"
107ifeq ($(origin TOOLS), undefined)
108                                $(error "variable TOOLS       is undefined");
109endif
110ifeq ($(origin DIR_MORPHEO), undefined)
111                                $(error "variable DIR_MORPHEO is undefined");
112endif
113
114$(DIR_OBJ)/%.o                  : $(DIR_SRC)/%.cpp $(HEADERS)
115                                @$(ECHO) "Compilation        : $*"
116                                @$(CXX) $(CXX_OPT) -c -o $@ $<
117
118$(DIR_OBJ)                      :
119                                @$(ECHO) "Create directory   : $@"
120                                @$(MKDIR) $@
121
122common_clean                    :
123                                @$(ECHO) "Delete     temporary files in directory "$(PWD)
124                                @$(RM)  $(DIR_OBJ)      \
125                                        $(DIR_BIN)      \
126                                        *~              \
127                                        $(DIR_SRC)/*~   \
128                                        $(DIR_INC)/*~
129
130common_help                     :
131                                @$(ECHO) " -----[ Common ]-------------------------------------"
132                                @$(ECHO) ""
133                                @$(ECHO) " * test_env             : test if environnment's variable is set"
134                                @$(ECHO) ""
Note: See TracBrowser for help on using the repository browser.