update Makefile

- add stamp file
- add pattern target
This commit is contained in:
Tuna
2017-06-01 01:03:42 +07:00
parent f4ad93a8cd
commit d655c817b4
3 changed files with 31 additions and 16 deletions
+1
View File
@@ -1,2 +1,3 @@
build
.installed-requirements
namibase/nami-linux-x64.tar.gz
+25 -16
View File
@@ -1,23 +1,32 @@
BIND_DIR := build
BUILD_DIR := build
MKDIR_P = mkdir -p
RM = rm -rf
default: build-all
.PHONY: build clean clobber
build-jessie:
$(MAKE) clean-up
${MKDIR_P} ${CURDIR}/${BIND_DIR}
./pre-build.sh
./mkimage ${CURDIR}/${BIND_DIR}/jessie.tar jessie
all: build
build-all:
$(MAKE) clean-up
./pre-build.sh
./buildall
clean:
${RM} ${CURDIR}/${BUILD_DIR}
test-jessie:
cat ${CURDIR}/${BIND_DIR}/jessie.tar | docker import - minideb:jessie
./test minideb:jessie
clobber: clean
@${RM} .installed-requirements
clean-up:
${RM} ${CURDIR}/${BIND_DIR}
.installed-requirements:
@echo "Installing required packages..."
@./pre-build.sh
@touch $@
build: .installed-requirements
@echo "Building all supported distros..."
@./buildall
%:
@echo "Building $@..."
@$(MAKE) .installed-requirements
@${MKDIR_P} ${CURDIR}/${BUILD_DIR}
./mkimage ${CURDIR}/${BUILD_DIR}/$@.tar $@
test-%:
@cat ${CURDIR}/${BUILD_DIR}/$*.tar | docker import - minideb:$*
@./test minideb:$*
+5
View File
@@ -4,5 +4,10 @@ set -e
set -u
set -o pipefail
if [[ ! -f /etc/debian_version ]]; then
echo "minideb can currently only be built on debian based distros, aborting..."
exit 1
fi
apt-get update
apt-get install -y debootstrap debian-archive-keyring jq dpkg-dev