11.1.7 Suffix Definitions
Dependency lists in which the target file type is ".o" and the dependent file type is ".c" normally contain a
command line to invoke the compiler. In other words, basically the same command line can be used common to
all dependency lists that process the same file type if only the file names can be replaced. The suffix definition is
a description of a list of file types (extensions) and commands to be executed and allows the make file to omit the
description of commands in each dependency list. This function helps simplify dependency lists when many source
files must be managed.
When a suffix definition has been made in the make file, the make.exe executes the commands described in the
suffix definition for the dependency list that have the same file type configuration as the suffix definition and does
not have a command description. If a dependency list has a command described, it is executed, not the command
in the suffix definition. Therefore, the specific dependency list can execute a different command from others by
describing the command in the normal form. This is useful when executing a different function only for the specific
source, or when using a source located in a different directory from the other sources.
The following shows the dependency lists without a suffix definition and with a suffix definition.
Dependency lists without a suffix definition
# dependency list start
### src definition start
SRC1_DIR= .
### src definition end
$(TARGET).elf : $(OBJS) $(TARGET).mak $(TARGET).lds
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(OBJLDS) $(LIBS)
## boot.s
boot.o : $(SRC1_DIR)/boot.s
$(AS) $(ASFLAGS) -o boot.o $(SRC1_DIR)/boot.s
## main.c
main.o : $(SRC1_DIR)/main.c
$(CC) $(CFLAGS) $(SRC1_DIR)/main.c
# dependency list end
Dependency lists with a suffix definition
# suffix & rule definitions
.SUFFIXES : .c .s .o .elf
.c.o :
$(CC) $(CFLAGS) -o $(SRC_DIR)/$*.o $(SRC_DIR)/$*.c
.s.o :
$(AS) $(ASFLAGS) -o $(SRC_DIR)/$*.o $(SRC_DIR)/$*.s
# dependency list start
### src definition start
### src definition end
$(TARGET).elf : $(OBJS) $(TARGET).mak $(TARGET).lds
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(OBJLDS) $(LIBS)
## boot.s
boot.o : $(SRC_DIR)/boot.s
## main.c
main.o : $(SRC_DIR)/main.c
## sub.c
sub.o : $(SRC_DIR)/sub.c
# dependency list end
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
EPSOn
11 OTHEr TOOlS
Suffix definition
Suffix rules
Dependency lists
11-11
11
Tools
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?