X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Makefile.common;h=e019689e44d8ff651178370e8cb9fa57cc2fe89a;hb=33cb87d48ecd68f2000d02659bb3752a329274c8;hp=23dddecde0e2fda7406faa7a6507fda09877b1e9;hpb=438cc451e19de412a731c3ad3679589ec4ec3c38;p=simavr diff --git a/Makefile.common b/Makefile.common index 23dddec..e019689 100644 --- a/Makefile.common +++ b/Makefile.common @@ -5,7 +5,7 @@ # # The code is compiled "optimized" to the max. # -# The wierd "-Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000" +# The weird "-Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000" # is used to tell the linker not to discard the .mmcu section, # otherwise the --gc-sections will delete it. # @@ -26,16 +26,25 @@ # You should have received a copy of the GNU General Public License # along with simavr. If not, see . +# simavr directory +SIMAVR ?= ${shell for p in . .. ../.. ../../..;do test -d $$p/simavr/sim && echo $$p/simavr; done} + +# You can override the build settings with local changes in this file +# for example: +# export CC=clang +# export CFLAGS=-march=corei7-avx +# etc +-include ${wildcard ${SIMAVR}/../.make.options*} + # 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/'} CFLAGS += -O2 -Wall CFLAGS += -g -ifeq ($(ARCH), i) -CFLAGS += -msse2 -endif ifeq (${shell uname}, Darwin) +# gcc 4.2 from MacOS is really not up to scratch anymore +CC = clang AVR_ROOT := "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/" AVR_INC := ${AVR_ROOT}/avr-4/ AVR := ${AVR_ROOT}/bin/avr- @@ -56,15 +65,12 @@ CPPFLAGS += ${patsubst %,-I%,${subst :, ,${IPATH}}} AVR_CPPFLAGS= ${CPPFLAGS} -idirafter ${AVR_INC}/include -CC = gcc +CC ?= clang AR ?= ar RANLIB ?= ranlib MKDIR ?= mkdir -p INSTALL ?= install SHELL := ${shell which bash} - -# simavr directory -SIMAVR ?= ${shell for p in . .. ../.. ../../..;do test -d $$p/simavr/sim && echo $$p/simavr; done} OBJ = obj-${shell $(CC) -dumpmachine} LIBDIR = ${shell pwd}/${SIMAVR}/${OBJ} @@ -79,7 +85,7 @@ endif # The code is compiled "optimized" to the max. # -# The wierd "-Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000" +# The weird "-Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000" # is used to tell the linker not to discard the .mmcu section, # otherwise the --gc-sections will delete it.