Improved PPC makefiles.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4650 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2012-09-13 14:06:32 +00:00
parent 037baacda7
commit 11a92bce55
5 changed files with 119 additions and 35 deletions

View File

@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = 2.5.0 PROJECT_NUMBER = 2.5.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer # for a project that appears at the top of each page and should give viewer

View File

@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = 2.5.0 PROJECT_NUMBER = 2.5.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer # for a project that appears at the top of each page and should give viewer

View File

@ -40,7 +40,7 @@
/** /**
* @brief Kernel version string. * @brief Kernel version string.
*/ */
#define CH_KERNEL_VERSION "2.5.0" #define CH_KERNEL_VERSION "2.5.1unstable"
/** /**
* @name Kernel version * @name Kernel version
@ -59,7 +59,7 @@
/** /**
* @brief Kernel version patch number. * @brief Kernel version patch number.
*/ */
#define CH_KERNEL_PATCH 0 #define CH_KERNEL_PATCH 1
/** @} */ /** @} */
/** /**

View File

@ -1,4 +1,14 @@
# PPC e200Z makefile scripts and rules. # PPC makefile scripts and rules.
# Output directory and files
ifeq ($(BUILDDIR),)
BUILDDIR = build
endif
ifeq ($(BUILDDIR),.)
BUILDDIR = build
endif
OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \
$(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp
# Automatic compiler options # Automatic compiler options
OPT = $(USE_OPT) OPT = $(USE_OPT)
@ -15,14 +25,20 @@ ifeq ($(USE_VLE),yes)
MCU += -mvle MCU += -mvle
endif endif
# Source files groups # Source files groups and paths
SRC = $(CSRC)$(CPPSRC) SRC = $(CSRC)$(CPPSRC)
SRCPATHS = $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(SRC)))
# Various directories
OBJDIR = $(BUILDDIR)/obj
LSTDIR = $(BUILDDIR)/lst
# Object files groups # Object files groups
COBJS = $(CSRC:.c=.o) COBJS = $(addprefix $(OBJDIR)/, $(notdir $(CSRC:.c=.o)))
CPPOBJS = $(CPPSRC:.cpp=.o) CPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(CPPSRC:.cpp=.o)))
ASMOBJS = $(ASMSRC:.s=.o) ASMOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMSRC:.s=.o)))
OBJS = $(ASMOBJS) $(COBJS) $(CPPOBJS) ASMXOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMXSRC:.S=.o)))
OBJS = $(ASMXOBJS) $(ASMOBJS) $(COBJS) $(CPPOBJS)
# Paths # Paths
IINCDIR = $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR)) IINCDIR = $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR))
@ -35,56 +51,119 @@ ADEFS = $(DADEFS) $(UADEFS)
# Libs # Libs
LIBS = $(DLIBS) $(ULIBS) LIBS = $(DLIBS) $(ULIBS)
# Various settings
MCFLAGS = -mcpu=$(MCU) MCFLAGS = -mcpu=$(MCU)
ODFLAGS = -x --syms ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(<:.s=.lst) $(ADEFS) ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
CPFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(<:.c=.lst) $(DEFS) ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
ifeq ($(LINK_GC),yes) CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR) CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
ifeq ($(USE_LINK_GC),yes)
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR)
else else
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR) LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR)
endif endif
# Generate dependency information # Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d CFLAGS += -MD -MP -MF .dep/$(@F).d
CPPFLAGS += -MD -MP -MF .dep/$(@F).d
# Paths where to search for sources
VPATH = $(SRCPATHS)
# #
# Makefile rules # Makefile rules
# #
all: $(OBJS) $(PROJECT).elf $(PROJECT).hex $(PROJECT).bin $(PROJECT).dmp MAKE_ALL_RULE_HOOK
all: $(OBJS) $(OUTFILES) MAKE_ALL_RULE_HOOK
MAKE_ALL_RULE_HOOK: MAKE_ALL_RULE_HOOK:
$(CPPOBJS) : %.o : %.cpp $(OBJS): | $(BUILDDIR)
@echo
$(CPPC) -c $(CPPFLAGS) -I . $(IINCDIR) $< -o $@
$(COBJS) : %.o : %.c $(BUILDDIR) $(OBJDIR) $(LSTDIR):
ifneq ($(USE_VERBOSE_COMPILE),yes)
@echo Compiler Options
@echo $(CC) -c $(CFLAGS) -I. $(IINCDIR) main.c -o main.o
@echo @echo
$(CC) -c $(CPFLAGS) -I . $(IINCDIR) $< -o $@ endif
mkdir -p $(OBJDIR)
mkdir -p $(LSTDIR)
$(ASMOBJS) : %.o : %.s $(CPPOBJS) : $(OBJDIR)/%.o : %.cpp Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo @echo
$(AS) -c $(ASFLAGS) -I . $(IINCDIR) $< -o $@ $(CPPC) -c $(CPPFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $<
@$(CPPC) -c $(CPPFLAGS) -I. $(IINCDIR) $< -o $@
endif
%elf: $(OBJS) $(COBJS) : $(OBJDIR)/%.o : %.c Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CC) -c $(CFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $<
@$(CC) -c $(CFLAGS) -I. $(IINCDIR) $< -o $@
endif
$(ASMOBJS) : $(OBJDIR)/%.o : %.s Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(AS) -c $(ASFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $<
@$(AS) -c $(ASFLAGS) -I. $(IINCDIR) $< -o $@
endif
$(ASMXOBJS) : $(OBJDIR)/%.o : %.S Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CC) -c $(ASXFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $<
@$(CC) -c $(ASXFLAGS) -I. $(IINCDIR) $< -o $@
endif
%.elf: $(OBJS) $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo @echo
$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@ $(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
else
@echo Linking $@
@$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
endif
%hex: %elf %.hex: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(HEX) $< $@ $(HEX) $< $@
else
@echo Creating $@
@$(HEX) $< $@
endif
%bin: %elf %.bin: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(BIN) $< $@ $(BIN) $< $@
else
@echo Creating $@
@$(BIN) $< $@
endif
%dmp: %elf %.dmp: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(OD) $(ODFLAGS) $< > $@ $(OD) $(ODFLAGS) $< > $@
else
@echo Creating $@
@$(OD) $(ODFLAGS) $< > $@
@echo Done
endif
clean: clean:
-rm -f $(OBJS) @echo Cleaning
-rm -f $(CSRC:.c=.lst) $(CPPSRC:.cpp=.lst) $(ASMSRC:.s=.lst) -rm -fR .dep $(BUILDDIR)
-rm -f $(PROJECT).elf $(PROJECT).dmp $(PROJECT).map $(PROJECT).hex $(PROJECT).bin @echo Done
-rm -fR .dep
# #
# Include the dependency files, should be the last of the makefile # Include the dependency files, should be the last of the makefile

View File

@ -81,6 +81,11 @@
*** Releases *** *** Releases ***
***************************************************************************** *****************************************************************************
*** 2.5.1 ***
- NEW: Added VLE support to the Power Architecture GCC port.
- NEW: Updated the Power Architecture rules.mk file to put object and listing
files into a ./build directory like ARM ports alread do.
*** 2.5.0 *** *** 2.5.0 ***
- FIX: Fixed anomaly in USB enumeration (bug 3565325)(backported to 2.4.3). - FIX: Fixed anomaly in USB enumeration (bug 3565325)(backported to 2.4.3).
- FIX: Fixed problem with lwIP statistics (bug 3564134)(backported to 2.4.3). - FIX: Fixed problem with lwIP statistics (bug 3564134)(backported to 2.4.3).