From 82975d226473da2002712800306be3080461491d Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 27 Aug 2015 10:37:11 +0200 Subject: [PATCH] Makefile to build archlinux-base image --- Makefile | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b07698a..6393af8 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,66 @@ +TODAY != date '+%Y-%M-%d' + +VERSION := $(TODAY)-1 +V_x86_64 := $(VERSION)_x86_64 +V_i686 := $(VERSION)_i686 + all: - @echo TODO + @echo The following targets are available: + @echo ' $(MAKE) base-x86_64' + @echo ' $(MAKE) base-i686' + @echo ' $(MAKE) default (same as make base-x86_64)' + +.PHONY: default +default: base-x86_64 + +# we should always regenerate this: +.PHONY: aab.conf aab.conf.x86_64 aab.conf.i686 +aab.conf: + echo 'Name: base' > aab.conf + echo 'Version: $(VERSION)' >> aab.conf + echo 'Section: optional' >> aab.conf + echo 'Maintainer: Proxmox Support Team ' >> aab.conf + echo 'Source: http://archlinux.cu.be/$$repo/os/$$arch' >> aab.conf + +aab.conf.x86_64: aab.conf + echo 'Architecture: x86_64' >> aab.conf +aab.conf.i686: aab.conf + echo 'Architecture: i686' >> aab.conf + +.PHONY: base-x86_64 +base-x86_64: archlinux-base_$(V_x86_64).tar.gz +archlinux-base_$(V_x86_64).tar.gz: aab.conf.x86_64 + echo 'Headline: ArchLinux base image.' >> aab.conf + $(MAKE) build-current + +.PHONY: base-xi686 +base-i686: archlinux-base_$(V_i686).tar.gz +archlinux-base_$(V_i686).tar.gz: aab.conf.i686 + echo 'Headline: ArchLinux base image.' >> aab.conf + $(MAKE) build-current + +.PHONY: build-current +build-current: check-all + ./aab init + ./aab bootstrap + ./aab finalize + ./aab clean + +.PHONY: check-pacman +check-pacman: + @which pacman >/dev/null || (echo Dependency error:; echo 'Please install the arch-pacman package'; echo; false) + +.PHONY: check-root +check-root: + @test 0 -eq "`id -u`" || (echo Permission error:; echo 'aab needs to be run as root'; echo; false) + +.PHONY: check-all +check-all: check-pacman check-root + +.PHONY: clean +clean: + @./aab clean + +.PHONY: distclean +distclean: + @./aab dist-clean