diff --git a/src/mod/applications/mod_enum/Makefile b/src/mod/applications/mod_enum/Makefile
index 446919d5c4..f747638cf1 100644
--- a/src/mod/applications/mod_enum/Makefile
+++ b/src/mod/applications/mod_enum/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_enum
 LOCAL_CFLAGS=-I$(BASE)/libs/udns
 LOCAL_LDFLAGS=
 LOCAL_OBJS=$(BASE)/libs/udns/libudns.a
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/udns && $(MAKE) staticlib
diff --git a/src/mod/asr_tts/mod_cepstral/Makefile b/src/mod/asr_tts/mod_cepstral/Makefile
index 83a57865b9..e5ff260078 100644
--- a/src/mod/asr_tts/mod_cepstral/Makefile
+++ b/src/mod/asr_tts/mod_cepstral/Makefile
@@ -2,6 +2,7 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 OSARCH=$(shell uname -s)
 # and define these variables to impact your build
+MODNAME=mod_cepstral
 
 ifeq ($(OSARCH),Darwin)
 LOCAL_LDFLAGS += -framework swift
@@ -10,5 +11,5 @@ LOCAL_LDFLAGS += -L/opt/swift/lib -lswift -lceplex_us -lceplang_en -lm
 LOCAL_CFLAGS += -I/opt/swift/include
 endif
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
diff --git a/src/mod/asr_tts/mod_lumenvox/Makefile b/src/mod/asr_tts/mod_lumenvox/Makefile
index e2b3ca3513..75bea42da1 100644
--- a/src/mod/asr_tts/mod_lumenvox/Makefile
+++ b/src/mod/asr_tts/mod_lumenvox/Makefile
@@ -2,9 +2,10 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_lumenvox
 LOCAL_CFLAGS= -fpermissive -Wno-deprecated -Wno-conversion -fpermissive -Wno-unused -Wno-comment -Wno-sign-compare \
 	-Wno-conversion -Wno-reorder -I/opt/lumenvox/eng\ine_7.0/include
 LOCAL_LDFLAGS= -L/opt/lumenvox/engine_7.0/lib -llv_lvspeechport
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
diff --git a/src/mod/codecs/mod_amr/Makefile b/src/mod/codecs/mod_amr/Makefile
index 5eb05d446c..5427797ef5 100644
--- a/src/mod/codecs/mod_amr/Makefile
+++ b/src/mod/codecs/mod_amr/Makefile
@@ -1,3 +1,4 @@
+MODNAME=mod_amr
 ifeq ($(shell ls -d $(BASE)/libs/amr),$(BASE)/libs/amr)
 
 LOCAL_CFLAGS += -I$(PREFIX)/include/amr
@@ -9,4 +10,4 @@ LOCAL_CFLAGS += -DAMR_PASSTHROUGH
 
 endif
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
diff --git a/src/mod/codecs/mod_g711/Makefile b/src/mod/codecs/mod_g711/Makefile
index b41e268b75..3d182e6c9c 100644
--- a/src/mod/codecs/mod_g711/Makefile
+++ b/src/mod/codecs/mod_g711/Makefile
@@ -2,9 +2,10 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_g711
 LOCAL_CFLAGS=-I$(BASE)/libs/codec/g7xx/src/include
 LOCAL_LDFLAGS=
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 
diff --git a/src/mod/codecs/mod_g722/Makefile b/src/mod/codecs/mod_g722/Makefile
index 8e33152719..2889c74669 100644
--- a/src/mod/codecs/mod_g722/Makefile
+++ b/src/mod/codecs/mod_g722/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_g722
 LOCAL_CFLAGS=-I$(BASE)/libs/codec/g7xx/src/include/
 LOCAL_LDFLAGS=$(BASE)/libs/codec/g7xx/libg7xx.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/codec/g7xx && $(MAKE)
diff --git a/src/mod/codecs/mod_g723_1/Makefile b/src/mod/codecs/mod_g723_1/Makefile
index 7c657a4e5c..67b0ef553e 100644
--- a/src/mod/codecs/mod_g723_1/Makefile
+++ b/src/mod/codecs/mod_g723_1/Makefile
@@ -1,7 +1,8 @@
+MODNAME=mod_g723_1
 ifeq ($(shell ls -d $(BASE)/libs/libg723_1),$(BASE)/libs/libg723_1)
 LOCAL_CFLAGS += -I$(PREFIX)/include/g723
 LOCAL_LDFLAGS +=-lg723
 else
 LOCAL_CFLAGS += -DG723_PASSTHROUGH
 endif
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
diff --git a/src/mod/codecs/mod_g726/Makefile b/src/mod/codecs/mod_g726/Makefile
index c9414b7a8b..39ad5ecf5a 100644
--- a/src/mod/codecs/mod_g726/Makefile
+++ b/src/mod/codecs/mod_g726/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_g726
 LOCAL_CFLAGS=-I$(BASE)/libs/codec/g726/src
 LOCAL_LDFLAGS=
 LOCAL_OBJS=$(BASE)/libs/codec/g726/libg726.la
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/codec/g726 && $(MAKE)
diff --git a/src/mod/codecs/mod_g729/Makefile b/src/mod/codecs/mod_g729/Makefile
index 5396f961ed..2edcfa8c7f 100644
--- a/src/mod/codecs/mod_g729/Makefile
+++ b/src/mod/codecs/mod_g729/Makefile
@@ -1,3 +1,4 @@
+MODNAME=mod_g729
 ifeq ($(shell ls -d $(BASE)/libs/libg729),$(BASE)/libs/libg729)
 LOCAL_CFLAGS += -I$(PREFIX)/include/libg729
 LOCAL_LDFLAGS +=-lg729
@@ -5,4 +6,4 @@ else
 LOCAL_CFLAGS += -DG729_PASSTHROUGH
 endif
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
diff --git a/src/mod/codecs/mod_gsm/Makefile b/src/mod/codecs/mod_gsm/Makefile
index 746e7194c1..b9020f68b5 100644
--- a/src/mod/codecs/mod_gsm/Makefile
+++ b/src/mod/codecs/mod_gsm/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_gsm
 LOCAL_CFLAGS=-I$(BASE)/libs/codec/gsm/inc
 LOCAL_LDFLAGS=$(BASE)/libs/codec/gsm/libgsm.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/codec/gsm && $(MAKE)
diff --git a/src/mod/codecs/mod_ilbc/Makefile b/src/mod/codecs/mod_ilbc/Makefile
index e6337eb069..4b9ec6d7c2 100644
--- a/src/mod/codecs/mod_ilbc/Makefile
+++ b/src/mod/codecs/mod_ilbc/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_ilbc
 LOCAL_CFLAGS=-I$(BASE)/libs/codec/ilbc/src
 LOCAL_LDFLAGS=$(BASE)/libs/codec/ilbc/libilbc.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/codec/ilbc && $(MAKE)
diff --git a/src/mod/codecs/mod_lpc10/Makefile b/src/mod/codecs/mod_lpc10/Makefile
index 0cfe0977ae..6698a64d2b 100644
--- a/src/mod/codecs/mod_lpc10/Makefile
+++ b/src/mod/codecs/mod_lpc10/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_lpc10
 LOCAL_CFLAGS=-I$(BASE)/libs/codec/lpc10/src
 LOCAL_LDFLAGS=$(BASE)/libs/codec/lpc10/liblpc10.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/codec/lpc10 && $(MAKE)
diff --git a/src/mod/codecs/mod_speex/Makefile b/src/mod/codecs/mod_speex/Makefile
index 03827a1809..5fe1b0fd04 100644
--- a/src/mod/codecs/mod_speex/Makefile
+++ b/src/mod/codecs/mod_speex/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_speex
 LOCAL_CFLAGS=-I$(BASE)/libs/speex/include
 LOCAL_LDFLAGS=$(BASE)/libs/speex/libspeex/libspeex.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/speex && $(MAKE)
diff --git a/src/mod/directories/mod_ldap/Makefile b/src/mod/directories/mod_ldap/Makefile
index 8bd32dc000..8cdb2e13b7 100644
--- a/src/mod/directories/mod_ldap/Makefile
+++ b/src/mod/directories/mod_ldap/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_ldap
 LOCAL_CFLAGS=-DWITH_OPENLDAP -DLDAP_DEPRECATED
 LOCAL_LDFLAGS=-lldap_r -llber
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install openldap-2.3.19.tgz --prefix=$(PREFIX) --disable-bdb --disable-hdb
diff --git a/src/mod/endpoints/mod_dingaling/Makefile b/src/mod/endpoints/mod_dingaling/Makefile
index cb91966a91..d1a60acb43 100644
--- a/src/mod/endpoints/mod_dingaling/Makefile
+++ b/src/mod/endpoints/mod_dingaling/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_dingaling
 LOCAL_CFLAGS=-I$(BASE)/libs/libdingaling/src
 LOCAL_LDFLAGS=$(BASE)/libs/libdingaling/libdingaling.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/iksemel && $(MAKE)
diff --git a/src/mod/endpoints/mod_iax/Makefile b/src/mod/endpoints/mod_iax/Makefile
index 3abbf346bf..17acba8899 100644
--- a/src/mod/endpoints/mod_iax/Makefile
+++ b/src/mod/endpoints/mod_iax/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_iax
 LOCAL_CFLAGS=-I$(BASE)/libs/iax/src
 LOCAL_LDFLAGS=$(BASE)/libs/iax/src/libiax.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/iax && $(MAKE)
diff --git a/src/mod/endpoints/mod_portaudio/Makefile b/src/mod/endpoints/mod_portaudio/Makefile
index 2f9d4c18be..72da1c9f14 100644
--- a/src/mod/endpoints/mod_portaudio/Makefile
+++ b/src/mod/endpoints/mod_portaudio/Makefile
@@ -2,6 +2,7 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 OSARCH=$(shell uname -s)
 # and define these variables to impact your build
+MODNAME=mod_portaudio
 LOCAL_CFLAGS=-I. -I$(BASE)/libs/portaudio/include
 LOCAL_LDFLAGS=$(BASE)/libs/portaudio/lib/libportaudio.la
 ifeq ($(OSARCH),Darwin)
@@ -9,7 +10,7 @@ LOCAL_LDFLAGS += -framework CoreAudio -framework AudioToolbox -framework AudioUn
 endif
 LOCAL_OBJS=pablio.o pa_ringbuffer.o
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/portaudio && $(MAKE)
diff --git a/src/mod/endpoints/mod_sofia/Makefile b/src/mod/endpoints/mod_sofia/Makefile
index b7a9546e46..fd005d3c41 100644
--- a/src/mod/endpoints/mod_sofia/Makefile
+++ b/src/mod/endpoints/mod_sofia/Makefile
@@ -1,3 +1,4 @@
+MODNAME=mod_sofia
 OS_ARCH         := $(subst /,_,$(shell uname -s | sed /\ /s//_/))
 
 LOCAL_CFLAGS  = -I. -I$(BASE)/libs/sofia-sip/libsofia-sip-ua/bnf  -I$(BASE)/libs/sofia-sip/libsofia-sip-ua/features
@@ -16,7 +17,7 @@ ifeq ($(OS_ARCH),Darwin)
 	LOCAL_LDFLAGS +=-framework CoreFoundation -framework SystemConfiguration
 endif
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/sofia-sip && $(MAKE)
diff --git a/src/mod/endpoints/mod_wanpipe/Makefile b/src/mod/endpoints/mod_wanpipe/Makefile
index f8484275e4..1ad0ea879c 100644
--- a/src/mod/endpoints/mod_wanpipe/Makefile
+++ b/src/mod/endpoints/mod_wanpipe/Makefile
@@ -2,11 +2,12 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_wanpipe
 LOCAL_CFLAGS  =-I/usr/local/include -I/usr/src/libpri -I/usr/src/linux/include -I. -I/usr/include 
 LOCAL_CFLAGS +=-D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -DAFT_A104 -DWANPIPE_TDM_API -I$(switch_srcdir)/libs/libteletone/src
 LOCAL_LDFLAGS=-lsangoma $(BASE)/libs/libteletone/libteletone.la
 LOCAL_OBJS=ss7boost_client.o
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libsangoma --prefix=$(PREFIX) --with-libpri=/usr/src/libpri
diff --git a/src/mod/event_handlers/mod_cdr/Makefile b/src/mod/event_handlers/mod_cdr/Makefile
index bed468b81e..944a4650f4 100644
--- a/src/mod/event_handlers/mod_cdr/Makefile
+++ b/src/mod/event_handlers/mod_cdr/Makefile
@@ -2,6 +2,7 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_cdr
 LOCAL_CFLAGS=
 LOCAL_LDFLAGS=
 LOCAL_OBJS=cdrcontainer.o basecdr.o baseregistry.o pddcdr.o csvcdr.o xmlcdr.o sqlitecdr.o
@@ -15,4 +16,4 @@ ifneq ($(shell which mysql_config),)
   LOCAL_OBJS    += mysqlcdr.o
 endif
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
diff --git a/src/mod/event_handlers/mod_xmpp_event/Makefile b/src/mod/event_handlers/mod_xmpp_event/Makefile
index acf42eebe5..038b301fa4 100644
--- a/src/mod/event_handlers/mod_xmpp_event/Makefile
+++ b/src/mod/event_handlers/mod_xmpp_event/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_xmpp_event
 LOCAL_CFLAGS=-I$(BASE)/libs/iksemel/include
 LOCAL_LDFLAGS=$(BASE)/libs/iksemel/src/libiksemel.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/iksemel && $(MAKE)
diff --git a/src/mod/event_handlers/mod_zeroconf/Makefile b/src/mod/event_handlers/mod_zeroconf/Makefile
index 1e2df5835c..80cc9850f7 100644
--- a/src/mod/event_handlers/mod_zeroconf/Makefile
+++ b/src/mod/event_handlers/mod_zeroconf/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_zeroconf
 LOCAL_CFLAGS=-I$(PREFIX)/include/howl
 LOCAL_LDFLAGS=-lhowl
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	$(BASE)/build/buildlib.sh $(BASE) install howl-1.0.0.tar.gz --prefix=$(PREFIX)
diff --git a/src/mod/formats/mod_shout/Makefile b/src/mod/formats/mod_shout/Makefile
index 0aacda471a..532d2d5596 100644
--- a/src/mod/formats/mod_shout/Makefile
+++ b/src/mod/formats/mod_shout/Makefile
@@ -2,6 +2,7 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_shout
 LAME=lame-3.97
 SHOUT=libshout-2.2.2
 LAMELA=$(BASE)/libs/$(LAME)/libmp3lame/libmp3lame.la
@@ -13,7 +14,7 @@ MP3OBJS=common.o dct64_i386.o decode_ntom.o layer3.o tabinit.o interface.o
 LOCAL_OBJS=$(MP3OBJS)
 DEFAULT_ARGS=--prefix=$(PREFIX) --disable-shared --with-pic
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 $(LAMELA):
 	MAKE="$(MAKE)" $(BASE)/build/buildlib.sh $(BASE) $(LAME).tar.gz $(DEFAULT_ARGS) --disable-decoder
diff --git a/src/mod/formats/mod_sndfile/Makefile b/src/mod/formats/mod_sndfile/Makefile
index 4cd07d354e..761963f3dc 100644
--- a/src/mod/formats/mod_sndfile/Makefile
+++ b/src/mod/formats/mod_sndfile/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MONAME=mod_sndfile
 LOCAL_CFLAGS=-I$(BASE)/libs/libsndfile/src
 LOCAL_LDFLAGS=$(BASE)/libs/libsndfile/src/libsndfile.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/libsndfile && $(MAKE)
diff --git a/src/mod/languages/mod_mono/Makefile b/src/mod/languages/mod_mono/Makefile
index 84bd0c4d0a..a333e0f259 100644
--- a/src/mod/languages/mod_mono/Makefile
+++ b/src/mod/languages/mod_mono/Makefile
@@ -1,3 +1,4 @@
+MODNAME=mod_mono
 VERSION = mono-1.1.13.8
 TARBALL = mono-1.1.13.8.tar.gz
 GLIB_TARBALL = glib-2.12.3.tar.gz
@@ -6,7 +7,7 @@ PKGCONFIG_TARBALL = pkg-config-0.21.tar.gz
 
 LOCAL_CFLAGS=`$(PREFIX)/bin/pkg-config --cflags mono`
 LOCAL_LDFLAGS=`$(PREFIX)/bin/pkg-config --libs mono`
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) configure install $(GETTEXT_TARBALL) --prefix=$(PREFIX) --with-pic
diff --git a/src/mod/languages/mod_perl/Makefile b/src/mod/languages/mod_perl/Makefile
index 3bf8b2dc6b..2b08ca2910 100644
--- a/src/mod/languages/mod_perl/Makefile
+++ b/src/mod/languages/mod_perl/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_perl
 LOCAL_CFLAGS=-DMULTIPLICITY $(shell $(PERL) -MExtUtils::Embed -e ccopts) -DEMBED_PERL
 LOCAL_LDFLAGS=$(shell $(PERL) -MExtUtils::Embed -e ldopts) $(shell $(PERL) -MConfig -e 'print $$Config{libs}')
 LOCAL_OBJS=perlxsi.o
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 PERL        = $(shell which perl)
 PERL_LIBDIR =-L$(shell perl -MConfig -e 'print $$Config{archlib}')/CORE
diff --git a/src/mod/languages/mod_python/Makefile b/src/mod/languages/mod_python/Makefile
index 917132589a..3ef92765e0 100644
--- a/src/mod/languages/mod_python/Makefile
+++ b/src/mod/languages/mod_python/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_python
 LOCAL_CFLAGS=-I$(PREFIX)/include/python2.4/
 LOCAL_LDFLAGS=-lpython2.4 -L$(PREFIX)/lib/python2.4/config/  -lutil -lstdc++
 LOCAL_OBJS=freeswitch_python.o mod_python_wrap.o
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 PYMOD=freeswitch
 
diff --git a/src/mod/languages/mod_spidermonkey/Makefile b/src/mod/languages/mod_spidermonkey/Makefile
index f0892c56c9..a4975536e0 100644
--- a/src/mod/languages/mod_spidermonkey/Makefile
+++ b/src/mod/languages/mod_spidermonkey/Makefile
@@ -1,9 +1,9 @@
-
+MODNAME=mod_spidermonkey
 include sm.mak
 LOCAL_CFLAGS  += -I$(BASE)/libs/curl/include
 LOCAL_LDFLAGS += $(BASE)/libs/curl/lib/libcurl.la
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/curl && $(MAKE)
diff --git a/src/mod/languages/mod_spidermonkey_core_db/Makefile b/src/mod/languages/mod_spidermonkey_core_db/Makefile
index dac7423c0e..e05a62716c 100644
--- a/src/mod/languages/mod_spidermonkey_core_db/Makefile
+++ b/src/mod/languages/mod_spidermonkey_core_db/Makefile
@@ -1,2 +1,3 @@
 include ../mod_spidermonkey/sm.mak
-include $(BASE)/build/modmake.rules
+MODNAME=mod_spidermonkey_core_db
+include ../../../../build/modmake.rules
diff --git a/src/mod/languages/mod_spidermonkey_etpan/Makefile b/src/mod/languages/mod_spidermonkey_etpan/Makefile
index a466d6458c..ba3ea0e311 100644
--- a/src/mod/languages/mod_spidermonkey_etpan/Makefile
+++ b/src/mod/languages/mod_spidermonkey_etpan/Makefile
@@ -3,10 +3,11 @@ include ../mod_spidermonkey/sm.mak
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_spidermonkey_etpan
 #LOCAL_CFLAGS=
 LOCAL_LDFLAGS+=-letpan
 #LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libetpan --prefix=$(PREFIX)
diff --git a/src/mod/languages/mod_spidermonkey_odbc/Makefile b/src/mod/languages/mod_spidermonkey_odbc/Makefile
index 549a54e985..3921b0a591 100644
--- a/src/mod/languages/mod_spidermonkey_odbc/Makefile
+++ b/src/mod/languages/mod_spidermonkey_odbc/Makefile
@@ -3,10 +3,11 @@ include ../mod_spidermonkey/sm.mak
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_spidermonkey_odbc
 #LOCAL_CFLAGS=
 LOCAL_LDFLAGS+=-lodbc
 #LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install unixODBC-2.2.12.tar.gz --prefix=$(PREFIX) --disable-gui --without-x --with-pic
diff --git a/src/mod/languages/mod_spidermonkey_skel/Makefile b/src/mod/languages/mod_spidermonkey_skel/Makefile
index 3bc6fcf2c7..5411b8f53e 100644
--- a/src/mod/languages/mod_spidermonkey_skel/Makefile
+++ b/src/mod/languages/mod_spidermonkey_skel/Makefile
@@ -1,3 +1,4 @@
 include ../mod_spidermonkey/sm.mak
-include $(BASE)/build/modmake.rules
+MODNAME=mod_spidermonkey_skel
+include ../../../../build/modmake.rules
 
diff --git a/src/mod/languages/mod_spidermonkey_teletone/Makefile b/src/mod/languages/mod_spidermonkey_teletone/Makefile
index 7c8180b693..d6e744b2a6 100644
--- a/src/mod/languages/mod_spidermonkey_teletone/Makefile
+++ b/src/mod/languages/mod_spidermonkey_teletone/Makefile
@@ -1,5 +1,5 @@
-
+MODNAME=mod_spidermonkey_teletone
 include ../mod_spidermonkey/sm.mak
 LOCAL_CFLAGS+=-I$(BASE)/libs/libteletone/src
 LOCAL_LDFLAGS+=$(BASE)/libs/libteletone/libteletone.la
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
diff --git a/src/mod/xml_int/mod_xml_curl/Makefile b/src/mod/xml_int/mod_xml_curl/Makefile
index 7c952bee9d..69edb38e9a 100644
--- a/src/mod/xml_int/mod_xml_curl/Makefile
+++ b/src/mod/xml_int/mod_xml_curl/Makefile
@@ -2,10 +2,11 @@
 # local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
 
 # and define these variables to impact your build
+MODNAME=mod_xml_curl
 LOCAL_CFLAGS=-I$(BASE)/libs/curl/include
 LOCAL_LDFLAGS=$(BASE)/libs/curl/lib/libcurl.la
 LOCAL_OBJS=
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/curl && $(MAKE)
diff --git a/src/mod/xml_int/mod_xml_rpc/Makefile b/src/mod/xml_int/mod_xml_rpc/Makefile
index bee68c81a8..a32bc53b81 100644
--- a/src/mod/xml_int/mod_xml_rpc/Makefile
+++ b/src/mod/xml_int/mod_xml_rpc/Makefile
@@ -1,11 +1,11 @@
-
+MODNAME=mod_xml_rpc
 LOCAL_LDFLAGS  = $(BASE)/libs/xmlrpc-c/src/libxmlrpc.la $(BASE)/libs/xmlrpc-c/src/libxmlrpc_server.la 
 LOCAL_LDFLAGS += $(BASE)/libs/xmlrpc-c/src/libxmlrpc_server_abyss.la $(BASE)/libs/xmlrpc-c/lib/abyss/src/libxmlrpc_abyss.la
 LOCAL_LDFLAGS += $(BASE)/libs/xmlrpc-c/lib/expat/xmlparse/libxmlrpc_xmlparse.la
 
 LOCAL_CFLAGS=-I$(BASE)/libs/xmlrpc-c/include
 
-include $(BASE)/build/modmake.rules
+include ../../../../build/modmake.rules
 
 local_depend:
 	cd $(BASE)/libs/xmlrpc-c && $(MAKE)