cores: Fix TWI interupt flag
[simavr] / Makefile.common
index 022f1f1..bc8e3ba 100644 (file)
 #      You should have received a copy of the GNU General Public License
 #      along with simavr.  If not, see <http://www.gnu.org/licenses/>.
 
-# get the first character of what the compiler says it is
-ARCH = ${shell $(CC) -dumpmachine | sed 's/\(.\).*/\1/'}
+# get the first character of what the compiler says it is, unless it's 'x86_64' doh
+ARCH = ${shell $(CC) -dumpmachine | sed -e 's/^x/i/' -e 's/\(.\).*/\1/'}
 
 ifeq ($(ARCH), i)
-CFLAGS += -mfpmath=sse -msse2 -fPIC
+CFLAGS += -mfpmath=sse -msse2
 endif
 
 CFLAGS += -g --std=gnu99
@@ -46,6 +46,7 @@ else
 AVR_ROOT := /usr/lib/avr
 AVR_INC := ${AVR_ROOT}
 AVR := avr-
+CFLAGS +=  -fPIC
 endif
 
 CC ?= gcc