summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-02-08 09:46:37 +0100
committerAlexander Larsson <alexl@redhat.com>2016-02-08 09:46:37 +0100
commit342c65bcde0bc82c889dc1d1a58126fda76bbe71 (patch)
tree362e6b3fc6c99126b9f1be2f42cc269180c6caa5
parent9fcbc1bfacb5524591a6e4570db1e5f35ab3f584 (diff)
Make dependencies more explicit
We rely on the timestamps of the ref files, which should make things more robust and avoid unnecessary commits if nothing changed.
-rw-r--r--Makefile48
1 files changed, 26 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 472a361..c126d66 100644
--- a/Makefile
+++ b/Makefile
@@ -3,45 +3,49 @@ builddir = $(CURDIR)
NULL=
ARCH=x86_64
-IMAGEDIR=images/$(ARCH)
-HASH:=$(shell git rev-parse HEAD)
-SDK_IMAGE=$(IMAGEDIR)/freedesktop-contents-sdk-$(ARCH)-$(HASH).tar.gz
-PLATFORM_IMAGE=$(IMAGEDIR)/freedesktop-contents-platform-$(ARCH)-$(HASH).tar.gz
-IMAGES= $(SDK_IMAGE) $(PLATFORM_IMAGE)
VERSION=1.4
+HASH:=$(shell git rev-parse HEAD)
+IMAGEDIR=images/${ARCH}
+SDK_IMAGE=${IMAGEDIR}/freedesktop-contents-sdk-${ARCH}-${HASH}.tar.gz
+PLATFORM_IMAGE=${IMAGEDIR}/freedesktop-contents-platform-${ARCH}-${HASH}.tar.gz
+IMAGES= ${SDK_IMAGE} ${PLATFORM_IMAGE}
+REF_PLATFORM=runtime/org.freedesktop.BasePlatform/${ARCH}/${VERSION}
+REF_SDK=runtime/org.freedesktop.BaseSdk/${ARCH}/${VERSION}
+FILE_REF_PLATFORM=repo/refs/heads/${REF_PLATFORM}
+FILE_REF_SDK=repo/refs/heads/${REF_SDK}
-all: $(IMAGES)
+all: ${FILE_REF_PLATFORM} ${FILE_REF_SDK}
COMMIT_ARGS=--generate-sizes --repo=repo --owner-uid=0 --owner-gid=0 --no-xattrs
- $(IMAGES) allimages:
+${IMAGES} allimages:
git submodule update --init
- mkdir -p build/$(ARCH)
- ./freedesktop-sdk-build-yocto $(srcdir)/ $(builddir)/build/ $(ARCH) $(HASH)
+ mkdir -p build/${ARCH}
+ ./freedesktop-sdk-build-yocto ${srcdir}/ ${builddir}/build/ ${ARCH} ${HASH}
repo:
ostree init --mode=archive-z2 --repo=repo
-.PHONY: commit-sdk commit-platform commit
+.PHONY: sdk platform
+
+sdk: ${FILE_REF_SDK}
-sdk: metadata.sdk $(SDK_IMAGE)
+${FILE_REF_SDK}: metadata.sdk ${SDK_IMAGE}
rm -rf sdk
mkdir sdk
- (cd sdk; tar --transform 's,^./usr,files,S' --transform 's,^./etc,files/etc,S' --exclude="./[!eu]*" -xvf ../$(SDK_IMAGE) > /dev/null)
+ (cd sdk; tar --transform 's,^./usr,files,S' --transform 's,^./etc,files/etc,S' --exclude="./[!eu]*" -xvf ../${SDK_IMAGE} > /dev/null)
cp metadata.sdk sdk/metadata
-
-commit-sdk: sdk repo
- ostree commit ${COMMIT_ARGS} ${GPG_ARGS} --branch=runtime/org.freedesktop.BaseSdk/${ARCH}/${VERSION} -s "build of ${HASH}" sdk
+ ostree commit ${COMMIT_ARGS} ${GPG_ARGS} --branch=${REF_SDK} -s "build of ${HASH}" sdk
ostree summary -u --repo=repo
+ rm -rf sdk
-platform: metadata.platform $(PLATFORM_IMAGE)
+platform: ${FILE_REF_PLATFORM}
+
+${FILE_REF_PLATFORM}: metadata.platform ${PLATFORM_IMAGE}
rm -rf platform
mkdir platform
- (cd platform; tar --transform 's,^./usr,files,S' --transform 's,^./etc,files/etc,S' --exclude="./[!eu]*" -xvf ../$(PLATFORM_IMAGE) > /dev/null)
+ (cd platform; tar --transform 's,^./usr,files,S' --transform 's,^./etc,files/etc,S' --exclude="./[!eu]*" -xvf ../${PLATFORM_IMAGE} > /dev/null)
cp metadata.platform platform/metadata
-
-commit-platform: platform
- ostree commit ${COMMIT_ARGS} ${GPG_ARGS} --branch=runtime/org.freedesktop.BasePlatform/${ARCH}/${VERSION} -s "build of ${HASH}" platform
+ ostree commit ${COMMIT_ARGS} ${GPG_ARGS} --branch=${REF_PLATFORM} -s "build of ${HASH}" platform
ostree summary -u --repo=repo
-
-commit: commit-sdk commit-platform
+ rm -rf platform