Skip to content

Instantly share code, notes, and snippets.

@rafaelcorsi
Last active May 29, 2020 07:04
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaelcorsi/329d71d36436cf7311a7 to your computer and use it in GitHub Desktop.
Save rafaelcorsi/329d71d36436cf7311a7 to your computer and use it in GitHub Desktop.
Convert Atmel Studio 7 generated makefile (windows paths) to linux, so you can compile your project from linux
#!/bin/sh
# Rafael Corsi
# corsiferrao@gmail.com
#
# Script to convert makefile generate from atmel studio 7 (windows)
# to linux path, assuming that you have gcc on PATH
#
# on Arch
# - sudo pacman -S arm-none-eabi-gcc
# - sudo pacman -S arm-none-eabi-newlib
#
# based on https://gist.github.com/theterg/6082389
# GPL
FILEMAKE=$1
if [ "$FILEMAKE" != "" ]; then
# remove ref to gcc windows path
sed -i 's/C:\\.*\\bin\\//g' $FILEMAKE
# remove ref to extension .bin
sed -i 's/.exe//g' $FILEMAKE
# remove SHELL
sed -i 's/SHELL := cmd//g' $FILEMAKE
else
echo "Usage: studio7_linux_conversion.sh MAKE FILE"
fi
@biboc
Copy link

biboc commented Dec 16, 2016

I would add this:
You need to remove all .d dependencies in the Makefile to make it work with Linux

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