mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 09:45:21 +03:00
Some cleaning in the Makefile, and 616bytes flash saved, thanks to Michal idea!
This commit is contained in:
parent
b5dbe135e7
commit
68c7aa108a
1 changed files with 4 additions and 58 deletions
62
src/Makefile
62
src/Makefile
|
@ -583,9 +583,7 @@ GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||||
|
|
||||||
# Combine all necessary flags and optional flags.
|
# Combine all necessary flags and optional flags.
|
||||||
# Add target processor to flags.
|
# Add target processor to flags.
|
||||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(AVRGCCFLAGS) -fwhole-program
|
||||||
ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(AVRGCCFLAGS)
|
|
||||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
|
||||||
|
|
||||||
MAJ_VER = ${shell sh -c "grep \"MAJ_VERS\" open9x.h | cut -d\ -f3 | egrep -o \"[[:digit:]]\""}
|
MAJ_VER = ${shell sh -c "grep \"MAJ_VERS\" open9x.h | cut -d\ -f3 | egrep -o \"[[:digit:]]\""}
|
||||||
MIN_VER = ${shell sh -c "grep \"MIN_VERS\" open9x.h | cut -d\ -f3"}
|
MIN_VER = ${shell sh -c "grep \"MIN_VERS\" open9x.h | cut -d\ -f3"}
|
||||||
|
@ -598,7 +596,6 @@ all: begin gccversion sizebefore build sizeafter end
|
||||||
|
|
||||||
# Change the build target to build a HEX file or a library.
|
# Change the build target to build a HEX file or a library.
|
||||||
build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm elf hex eep lss sym
|
build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm elf hex eep lss sym
|
||||||
#build: lib
|
|
||||||
|
|
||||||
|
|
||||||
elf: $(TARGET).elf
|
elf: $(TARGET).elf
|
||||||
|
@ -606,9 +603,6 @@ hex: $(TARGET).hex
|
||||||
eep: $(TARGET).eep
|
eep: $(TARGET).eep
|
||||||
lss: $(TARGET).lss
|
lss: $(TARGET).lss
|
||||||
sym: $(TARGET).sym
|
sym: $(TARGET).sym
|
||||||
LIBNAME=lib$(TARGET).a
|
|
||||||
lib: $(LIBNAME)
|
|
||||||
|
|
||||||
|
|
||||||
# Build stamp-file
|
# Build stamp-file
|
||||||
stamp_header:
|
stamp_header:
|
||||||
|
@ -795,61 +789,13 @@ extcoff: $(TARGET).elf
|
||||||
@echo $(MSG_SYMBOL_TABLE) $@
|
@echo $(MSG_SYMBOL_TABLE) $@
|
||||||
$(NM) -n $< > $@
|
$(NM) -n $< > $@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create library from object files.
|
|
||||||
.SECONDARY : $(TARGET).a
|
|
||||||
.PRECIOUS : $(OBJ)
|
|
||||||
%.a: $(OBJ)
|
|
||||||
@echo
|
|
||||||
@echo $(MSG_CREATING_LIBRARY) $@
|
|
||||||
$(AR) $@ $(OBJ)
|
|
||||||
|
|
||||||
|
|
||||||
# Link: create ELF output file from object files.
|
# Link: create ELF output file from object files.
|
||||||
.SECONDARY : $(TARGET).elf
|
%.elf:
|
||||||
.PRECIOUS : $(OBJ)
|
|
||||||
%.elf: $(OBJ)
|
|
||||||
@echo
|
@echo
|
||||||
@echo $(MSG_LINKING) $@
|
@echo $(MSG_LINKING) $@
|
||||||
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
|
cat $(CPPSRC) > allsrc.cpp
|
||||||
|
|
||||||
|
|
||||||
# Compile: create object files from C source files.
|
|
||||||
$(OBJDIR)/%.o : %.c
|
|
||||||
@echo
|
@echo
|
||||||
@echo $(MSG_COMPILING) $<
|
$(CC) $(ALL_CPPFLAGS) allsrc.cpp --output $@ $(LDFLAGS)
|
||||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
# Compile: create object files from C++ source files.
|
|
||||||
$(OBJDIR)/%.o : %.cpp
|
|
||||||
@echo
|
|
||||||
@echo $(MSG_COMPILING_CPP) $<
|
|
||||||
$(CC) -c $(ALL_CPPFLAGS) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
# Compile: create assembler files from C source files.
|
|
||||||
%.s : %.c
|
|
||||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
# Compile: create assembler files from C++ source files.
|
|
||||||
%.s : %.cpp
|
|
||||||
$(CC) -S $(ALL_CPPFLAGS) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
# Assemble: create object files from assembler source files.
|
|
||||||
$(OBJDIR)/%.o : %.S
|
|
||||||
@echo
|
|
||||||
@echo $(MSG_ASSEMBLING) $<
|
|
||||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
# Create preprocessed source for use in sending a bug report.
|
|
||||||
%.i : %.c
|
|
||||||
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
# Target: clean project.
|
# Target: clean project.
|
||||||
clean: begin clean_list end
|
clean: begin clean_list end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue