diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 014dde4744428a75c3536d69e01ec2a1225cda48..183337a45e5c106f25800b5f662960b6a78d82b8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,6 +8,27 @@ stages:
 # BUILD #
 #########
 
+build-mage:
+  stage: build
+  tags:
+    - linux
+  rules:
+    - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
+  variables:
+    GIT_SUBMODULE_STRATEGY: recursive
+    GIT_SUBMODULE_DEPTH: 1
+  script:
+    - cd mage/src/
+    - mkdir -p build
+    - cd build
+    - cmake ..
+    - make
+  artifacts:
+    paths:
+      - mage/src/build/mage
+      - mage/src/build/mage_extraire
+      - mage/src/build/mailleurPF
+
 build:
   stage: build
   tags:
@@ -53,6 +74,8 @@ linux-package:
       artifacts: true
     - job: build
       artifacts: true
+    - job: build-mage
+      artifacts: true
   rules:
     - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
   artifacts:
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000000000000000000000000000000000..0aad7c1d9b280a13e25d6f1328d2bff3bf9be866
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "mage"]
+	path = mage
+	url = https://gitlab.irstea.fr/jean-baptiste.faure/mage.git
diff --git a/mage b/mage
new file mode 160000
index 0000000000000000000000000000000000000000..18aa9a7e0f8415a94a40fe647d329268c6932663
--- /dev/null
+++ b/mage
@@ -0,0 +1 @@
+Subproject commit 18aa9a7e0f8415a94a40fe647d329268c6932663
diff --git a/packages/linux.sh b/packages/linux.sh
index 938e4ff985fe5325573bf1d952c2b742b388917d..899aa4b84d3b433ed798cda84f3bcb155d36d109 100755
--- a/packages/linux.sh
+++ b/packages/linux.sh
@@ -38,6 +38,10 @@ cp -r ../src/lang/*.qm dist/pamhyr/lang/
 cp ../VERSION dist/pamhyr/
 cp ../AUTHORS dist/pamhyr/
 
+cp ../mage/src/build/mage dist/pamhyr/
+cp ../mage/src/build/mage_extraire dist/pamhyr/
+cp ../mage/src/build/mailleurPF dist/pamhyr/
+
 echo " *** MAKE SRC PACKAGE"
 
 OLD_PWD=$PWD