add format target

fix newline to "lf" when executing uncrustify
This commit is contained in:
Oliver Lehmann 2013-05-04 14:53:30 +00:00
parent 0951ff350c
commit 41313fdd7b
3 changed files with 15 additions and 6 deletions

View File

@ -2,9 +2,9 @@ OUTPUT_FILE=P8000_WDC_Emulator
MCU= -mmcu=atmega1284p MCU= -mmcu=atmega1284p
CC=avr-gcc CC=avr-gcc
CFLAGS= -I/usr/local/avr/include -funsigned-char -funsigned-bitfields -O1 \ CFLAGS= -I/usr/local/avr/include -funsigned-char -funsigned-bitfields \
-ffunction-sections -fpack-struct -fshort-enums -Wall -Wundef \ -O1 -ffunction-sections -fpack-struct -fshort-enums -Wall \
-Werror -pedantic -pedantic-errors -c ${MCU} -Wundef -Werror -pedantic -pedantic-errors ${MCU}
LDFLAGS=-Wl,-Map="${OUTPUT_FILE}.map" -Wl,--start-group -Wl,-lm \ LDFLAGS=-Wl,-Map="${OUTPUT_FILE}.map" -Wl,--start-group -Wl,-lm \
-Wl,--end-group -Wl,--gc-sections ${MCU} -Wl,--end-group -Wl,--gc-sections ${MCU}
@ -30,9 +30,14 @@ ${OUTPUT_FILE}: ${OBJS}
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.hex" avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.hex"
avr-objcopy -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.eep" || exit 0 avr-objcopy -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.eep" || exit 0
avr-objdump -h -S "${OUTPUT_FILE}.elf" > "${OUTPUT_FILE}.lss" avr-objdump -h -S "${OUTPUT_FILE}.elf" > "${OUTPUT_FILE}.lss"
avr-objcopy -O srec -R .eeprom -R .fuse -R .lock -R .signature "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.srec"
avr-size "${OUTPUT_FILE}.elf" avr-size "${OUTPUT_FILE}.elf"
clean: clean:
-${RM} ${OBJS} -${RM} ${OBJS}
rm -rf "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.a" "${OUTPUT_FILE}.hex" "${OUTPUT_FILE}.lss" "${OUTPUT_FILE}.eep" "${OUTPUT_FILE}.map" rm -rf "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.a" "${OUTPUT_FILE}.hex" "${OUTPUT_FILE}.lss" "${OUTPUT_FILE}.eep" "${OUTPUT_FILE}.map" "${OUTPUT_FILE}.srec"
format:
for file in *.h *.c ; do \
uncrustify -l C -c ../uncrustify.cfg --no-backup $$file ;\
done

View File

@ -1,3 +1,4 @@
newlines = lf
indent_columns = 4 indent_columns = 4
indent_with_tabs = 0 indent_with_tabs = 0
indent_switch_case = 4 indent_switch_case = 4
@ -33,7 +34,7 @@ mod_remove_extra_semicolon = true
sp_return_paren = force sp_return_paren = force
sp_sizeof_paren = remove sp_sizeof_paren = remove
sp_before_sparen = remove sp_before_sparen = force
sp_after_sparen = force sp_after_sparen = force
sp_after_cast = remove sp_after_cast = remove
sp_inside_braces = force sp_inside_braces = force
@ -54,6 +55,9 @@ sp_inside_fparen = force
sp_paren_brace = force sp_paren_brace = force
sp_sparen_brace = force sp_sparen_brace = force
sp_fparen_brace = force sp_fparen_brace = force
sp_func_call_paren = add
sp_func_call_paren_empty = remove
align_struct_init_span = 0 align_struct_init_span = 0
align_func_params = true align_func_params = true
align_var_def_span = 3 align_var_def_span = 3