X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Makefile.common;h=3658ae56c52865d85d9b65f40c042bae454f2a7d;hb=43c83e991c0705b7dc981ca760aa14fd3331604c;hp=e019689e44d8ff651178370e8cb9fa57cc2fe89a;hpb=6d2da708b0b554f5f70d0c74ce09d4dd279d49d2;p=simavr diff --git a/Makefile.common b/Makefile.common index e019689..3658ae5 100644 --- a/Makefile.common +++ b/Makefile.common @@ -27,7 +27,7 @@ # along with simavr. If not, see . # simavr directory -SIMAVR ?= ${shell for p in . .. ../.. ../../..;do test -d $$p/simavr/sim && echo $$p/simavr; done} +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: @@ -79,9 +79,15 @@ LDFLAGS += -L${LIBDIR} -lsimavr LDFLAGS += -lelf ifeq (${shell uname}, Linux) +ifeq ($(RELEASE),1) +# allow the shared library to be found in the build directory +# only for linking, the install time location is used at runtime +LFLAGS += -Wl,-rpath-link,${LIBDIR} +else # allow the shared library to be found in the build directory LFLAGS += -Wl,-rpath,${LIBDIR} endif +endif # The code is compiled "optimized" to the max. # @@ -106,7 +112,7 @@ endif -ffunction-sections -fdata-sections \ -Wl,--relax,--gc-sections \ -Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000 \ - -I../include -I../../include \ + -I../simavr/sim/avr -I../../simavr/sim/avr \ ${^} -o ${@} @${AVR}size ${@}|sed '1d'