--- a/modules/libbz2/Makefile.in
+++ b/modules/libbz2/Makefile.in
@@ -7,11 +7,10 @@
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = libbz2
-DIRS = src
include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/modules/libbz2/moz.build
@@ -0,0 +1,6 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += ['src']
new file mode 100644
--- /dev/null
+++ b/modules/libbz2/src/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
--- a/modules/libjar/Makefile.in
+++ b/modules/libjar/Makefile.in
@@ -6,27 +6,16 @@
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(srcdir)/objs.mk
-DIRS =
-
-ifdef MOZ_ZIPWRITER
-DIRS += zipwriter
-endif
-
-ifdef ENABLE_TESTS
-TOOL_DIRS += test
-endif
-
-
MODULE = jar
LIBRARY_NAME = jar$(VERSION_NUMBER)
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsJarModule
GRE_MODULE = 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
new file mode 100644
--- /dev/null
+++ b/modules/libjar/moz.build
@@ -0,0 +1,9 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+if CONFIG['MOZ_ZIPWRITER']:
+ DIRS += ['zipwriter']
+
+TEST_TOOL_DIRS += ['test']
--- a/modules/libjar/test/Makefile.in
+++ b/modules/libjar/test/Makefile.in
@@ -10,11 +10,9 @@ VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = test_libjar
XPCSHELL_TESTS = unit
-DIRS = mochitest chrome
-
include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/modules/libjar/test/chrome/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libjar/test/mochitest/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libjar/test/moz.build
@@ -0,0 +1,6 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += ['mochitest', 'chrome']
--- a/modules/libjar/zipwriter/Makefile.in
+++ b/modules/libjar/zipwriter/Makefile.in
@@ -6,13 +6,9 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = zipwriter
-DIRS = public src
-
-TEST_DIRS += test
-
include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/modules/libjar/zipwriter/moz.build
@@ -0,0 +1,7 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += ['public', 'src']
+TEST_DIRS += ['test']
new file mode 100644
--- /dev/null
+++ b/modules/libjar/zipwriter/public/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libjar/zipwriter/src/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libjar/zipwriter/test/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
--- a/modules/libmar/Makefile.in
+++ b/modules/libmar/Makefile.in
@@ -6,28 +6,11 @@
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-DIRS = src
MODULE = libmar_test
-ifdef MOZ_ENABLE_SIGNMAR
-DIRS += sign verify
-else
-ifeq ($(OS_ARCH),WINNT)
-# On Windows we don't verify with NSS and updater needs to link to it
-DIRS += verify
-endif
-endif
-
-# If we are building ./sign and ./verify then ./tool must come after it
-DIRS += tool
-
-ifdef MOZ_ENABLE_SIGNMAR
-TEST_DIRS += tests
-endif
-
include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/modules/libmar/moz.build
@@ -0,0 +1,16 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += ['src']
+
+if CONFIG['MOZ_ENABLE_SIGNMAR']:
+ DIRS += ['sign', 'verify']
+ TEST_DIRS += ['tests']
+elif CONFIG['OS_ARCH'] == 'WINNT':
+ # On Windows we don't verify with NSS and updater needs to link to it
+ DIRS += ['verify']
+
+# If we are building ./sign and ./verify then ./tool must come after it
+DIRS += ['tool']
new file mode 100644
--- /dev/null
+++ b/modules/libmar/sign/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libmar/src/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libmar/tests/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libmar/tool/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libmar/verify/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
--- a/modules/libpref/Makefile.in
+++ b/modules/libpref/Makefile.in
@@ -5,17 +5,12 @@
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-ifdef ENABLE_TESTS
-TOOL_DIRS += test
-endif
-
MODULE = pref
-DIRS = public src
include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/modules/libpref/moz.build
@@ -0,0 +1,7 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += ['public', 'src']
+TEST_TOOL_DIRS += ['test']
new file mode 100644
--- /dev/null
+++ b/modules/libpref/public/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libpref/src/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
new file mode 100644
--- /dev/null
+++ b/modules/libpref/test/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
--- a/modules/zlib/Makefile.in
+++ b/modules/zlib/Makefile.in
@@ -6,12 +6,11 @@
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = zlib
-DIRS = src
include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/modules/zlib/moz.build
@@ -0,0 +1,6 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += ['src']
new file mode 100644
--- /dev/null
+++ b/modules/zlib/src/moz.build
@@ -0,0 +1,5 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+