source: trunk/Softwares/Makefile.Software @ 112

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1#
2# $Id: Makefile.Software 112 2009-03-18 22:36:26Z 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
14
15#-----[ Directory ]---------------------------------------------------------------
16DIR_OBJ                         = obj
17DIR_BIN                         = bin
18
19EXE                             = soft
20
21DIR_COMMON              = $(MORPHEO_TOPLEVEL)/Softwares/Common
22DIR_COMMON_C            = $(DIR_COMMON)/src/c
23DIR_COMMON_ASM          = $(DIR_COMMON)/src/asm
24DIR_COMMON_SYS          = $(DIR_COMMON)/src/sys
25DIR_COMMON_INC          = $(DIR_COMMON)/include
26
27OBJECTS_COMMON          =       $(patsubst $(DIR_COMMON_SYS)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_SYS)/*.s))      \
28                                $(patsubst $(DIR_COMMON_ASM)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_ASM)/*.s))      \
29                                $(patsubst $(DIR_COMMON_C)/%.c,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_C)/*.c))
30
31
32#-----[ To the compilation ]------------------------------------------------------
33OPTIMIZE                        = -O2 -std=c99 -fomit-frame-pointer -fdelayed-branch -mror -mcmov -msext -mhard-mul -msoft-div -msoft-float
34
35#Option :
36# -fomit-frame-pointer                  : n'utilise pas le pointeur de frame
37# -fdelayed-branch                      : utilise les delayed slot
38# ON            OFF
39# -mror         -mno-ror                : utilisation de l'instruction l.ror
40# -mcmov        -mno-cmov               : utilisation de l'instruction l.cmov
41# -msext        -mno-sext               : utilisation des instructions l.extXX
42# -mhard-mul    -msoft-mul              : utilisation du multiplieur materiel
43# -mhard-div    -msoft-div              : utilisation du diviseur materiel
44# -mhard-float  -msoft-float            : utilisation du flottant materiel
45# -msibcall     -mno-sibcall            : Enable sibcall optimization
46# -mlogue       -mno-logue              : Schedule pro/epi-logue.
47# -maj          -mno-aj                 : Use aligned jumps.
48
49# Tools
50OR32_CC                         = $(OR1K_BIN)/or32-elf-gcc
51OR32_AS                         = $(OR1K_BIN)/or32-elf-as
52OR32_LD                         = $(OR1K_BIN)/or32-elf-ld
53OR32_OBJDUMP                    = $(OR1K_BIN)/or32-elf-objdump
54OR32_NM                         = $(OR1K_BIN)/or32-elf-nm
55
56# Tools's option
57OR32_CC_OPT                     = -Wall $(INCDIR) $(OPTIMIZE) -Wlong-long -DMorpheo
58# -DHAVE_LIBC
59OR32_AS_OPT                     =
60OR32_LD_OPT                     = -T$(DIR_LDSCRIPT)/or32.ld $(LIBDIR) $(LIBNAME) $(OR1K_LIBDIR) $(OR1K_LIBNAME)
61OR32_OBJDUMP_OPT                = -D
62OR32_NM_OPT                     = -n
63
64#-----[ Rules ]-------------------------------------------------------------------
65.PRECIOUS                       : $(DIR_BIN)/%.x.txt $(DIR_BIN)/%.x $(DIR_OBJ)/%.o
66
67vpath   %.h     $(DIR_INC):$(DIR_COMMON_INC)
68vpath   %.c     $(DIR_C):$(DIR_COMMON_C)
69vpath   %.s     $(DIR_ASM):$(DIR_SYS):$(DIR_COMMON_ASM):$(DIR_COMMON_SYS)
70vpath   %.o     $(DIR_OBJ)
71vpath   %.x     $(DIR_BIN)
72
73all                             :
74                                @\
75                                $(MKDIR) $(DIR_BIN) $(DIR_OBJ);                 \
76                                $(MAKE)  $(DIR_BIN)/$(EXE).x;
77
78$(DIR_BIN)/%.x                  : $(OBJECTS)
79                                @\
80                                $(ECHO) "Linkage            : $*.x";            \
81                                $(OR32_LD) -o $@ $^ $(OR32_LD_OPT);             \
82                                $(ECHO) "List symbols       : $*.x.nm";         \
83                                $(OR32_NM)      $(OR32_NM_OPT)      $^ > $@.nm; \
84                                $(ECHO) "Display info       : $*.x.txt";        \
85                                $(OR32_OBJDUMP) $(OR32_OBJDUMP_OPT) $@ > $@.txt;\
86                                echo $($(GREP) "l.jal 0" $@.txt);
87
88$(DIR_OBJ)/%.o                  : %.s   
89                                @\
90                                $(ECHO) "Compilation        : $*.s";            \
91                                $(OR32_CC) $(OR32_CC_OPT)     -o $@   -c $^ ;   \
92                                $(OR32_CC) $(OR32_CC_OPT)  -S -o $@.s -c $^ ;
93#                               @$(OR32_AS) $(OR32_AS_OPT) $^ -o $@
94
95$(DIR_OBJ)/%.o                  : %.c
96                                @\
97                                $(ECHO) "Compilation        : $*.c";            \
98                                $(OR32_CC) $(OR32_CC_OPT)     -o $@   -c $^ ;   \
99                                $(OR32_CC) $(OR32_CC_OPT)  -S -o $@.s -c $^ ;
100
101#-----[ Maintenance ]-------------------------------------------------------------
102clean                           :
103                                @\
104                                $(ECHO) "Delete     temporary files";           \
105                                $(RM)   $(DIR_OBJ) $(DIR_BIN)   \
106                                        *~                      \
107                                        $(DIR_SRC)/*~           \
108                                        $(DIR_C)/*~             \
109                                        $(DIR_ASM)/*~           \
110                                        $(DIR_SYS)/*~           \
111                                        $(DIR_INC)/*~           \
112                                        $(DIR_LDSCRIPT)/*~      \
113
114clean_all                       : clean
115
116#-----[ Help ]--------------------------------------------------------------------
117help                            :
118                                @\
119                                $(ECHO) "";\
120                                $(ECHO) "List of directive   : ";\
121                                $(ECHO) " * all              : Compile the software";\
122                                $(ECHO) " * clean            : Erase all files generates";\
123                                $(ECHO) " * clean_all        : Erase all files generates";\
124                                $(ECHO) "";
Note: See TracBrowser for help on using the repository browser.