Skip to content

Instantly share code, notes, and snippets.

@theterg
Created July 25, 2013 18:24
Show Gist options
  • Select an option

  • Save theterg/6082389 to your computer and use it in GitHub Desktop.

Select an option

Save theterg/6082389 to your computer and use it in GitHub Desktop.
A script to convert a Makefile produced by Atmel Studio 6 for arm-none-eabi on a linux host.
#!/bin/sh
PROJECT_NAME=$1
if [ "$PROJECT_NAME" != "" ]; then
# TARGET_DIR=${PROJECT_NAME}/${PROJECT_NAME}/Debug
TARGET_DIR=${PROJECT_NAME}
find ${TARGET_DIR} -iname "*.d" -type f -exec sed -i 's/c:\\.*\\bin\\//g' {} \;
sed -i 's/cmd.exe/sh/g' ${TARGET_DIR}/Makefile
sed -i 's/C:\\.*\\bin\\arm-none-eabi-gcc.exe/arm-none-eabi-gcc/g' ${TARGET_DIR}/Makefile
sed -i 's/C:\\.*\\bin\\arm-none-eabi-objcopy.exe/arm-none-eabi-objcopy/g' ${TARGET_DIR}/Makefile
sed -i 's/C:\\.*\\bin\\arm-none-eabi-size.exe/arm-none-eabi-size/g' ${TARGET_DIR}/Makefile
sed -i 's/C:\\.*\\bin\\arm-none-eabi-objdump.exe/arm-none-eabi-objdump/g' ${TARGET_DIR}/Makefile
sed -i 's/\/src\/ASF\//\/src\/asf\//g' ${TARGET_DIR}/Makefile
else
echo "Usage: studio6_linux_conversion.sh PROJECT_NAME (e.g. the project directory name)"
fi
@rafaelcorsi
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment