aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/make/build-rules.mk
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/software/make/build-rules.mk')
-rw-r--r--reproduce/software/make/build-rules.mk61
1 files changed, 45 insertions, 16 deletions
diff --git a/reproduce/software/make/build-rules.mk b/reproduce/software/make/build-rules.mk
index 8d78ce3..260ded8 100644
--- a/reproduce/software/make/build-rules.mk
+++ b/reproduce/software/make/build-rules.mk
@@ -5,15 +5,18 @@
#
# Copyright (C) 2018-2020 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
-# This Makefile is part of Maneage. Maneage is free software: you can
-# redistribute it and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# This Makefile is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# Maneage is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details. See <http://www.gnu.org/licenses/>.
+# This Makefile is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this Makefile. If not, see <http://www.gnu.org/licenses/>.
@@ -31,6 +34,31 @@
+# Unpack a tarball in the current directory. The issue is that until we
+# install GNU Tar within Maneage, we have to use the host's Tar
+# implementation and in some cases, they don't recognize '.lz'.
+uncompress = csuffix=$$(echo $$tarball \
+ | sed -e's/\./ /g' \
+ | awk '{print $$NF}'); \
+ if [ x$$csuffix = xlz ]; then \
+ intarrm=1; \
+ intar=$$(echo $$tarball | sed -e's/.lz//'); \
+ lzip -c -d $$tarball > $$intar; \
+ else \
+ intarrm=0; \
+ intar=$$tarball; \
+ fi; \
+ if tar xf $$intar; then \
+ if [ x$$intarrm = x1 ]; then rm $$intar; fi; \
+ else \
+ echo; echo "Tar error"; exit 1; \
+ fi
+
+
+
+
+
+
# GNU Build system
# ----------------
#
@@ -55,13 +83,13 @@ gbuild = if [ x$(static_build) = xyes ] && [ "x$(2)" = xstatic ]; then \
fi; \
check="$(5)"; \
if [ x"$$check" = x ]; then check="echo Skipping-check"; fi; \
- cd $(ddir); rm -rf $(1); \
+ cd $(ddir); \
+ rm -rf $(1); \
if [ x"$$gbuild_tar" = x ]; then \
- tarball=$(word 1,$(filter $(tdir)/%,$|)); \
+ tarball=$(word 1,$(filter $(tdir)/%,$^)); \
else tarball=$$gbuild_tar; \
fi; \
- if ! tar xf $$tarball; then \
- echo; echo "Tar error"; exit 1; fi; \
+ $(call uncompress); \
cd $(1); \
\
if [ x"$(strip $(6))" = x ]; then confscript=./configure; \
@@ -111,10 +139,11 @@ cbuild = if [ x$(static_build) = xyes ] && [ $(2)x = staticx ]; then \
export LDFLAGS="$$LDFLAGS -static"; \
opts="-DBUILD_SHARED_LIBS=OFF"; \
fi; \
- cd $(ddir) \
- && rm -rf $(1) \
- && tar xf $(word 1,$(filter $(tdir)/%,$|)) \
- && cd $(1) \
+ tarball=$(word 1,$(filter $(tdir)/%,$^)); \
+ cd $(ddir); \
+ rm -rf $(1); \
+ $(call uncompress); \
+ cd $(1) \
&& rm -rf project-build \
&& mkdir project-build \
&& cd project-build \