Add submodules to build/packages
Using symlinks the submodules are added to appear just like any downloaded unpacked tar. Also added a Makefile clean rule to clean the submodules, which includes Reseting the submodules to the origin branch state, including ignored files.
This commit is contained in:
parent
46e8eb22a8
commit
c86f506e90
23
Makefile
23
Makefile
@ -1,6 +1,8 @@
|
||||
ARCHS := x86_64 arm aarch64 powerpc mips mipsel
|
||||
TARGETS := $(addprefix build-, $(ARCHS))
|
||||
PACK_TARGETS := $(addprefix pack-, $(ARCHS))
|
||||
SUBMODULE_PACKAGES := $(wildcard src/submodule_packages/*)
|
||||
BUILD_PACKAGES_DIR := "build/packages"
|
||||
|
||||
.PHONY: clean help download_packages build build-docker-image $(TARGETS) $(PACK_TARGETS)
|
||||
|
||||
@ -23,22 +25,28 @@ build/build-docker-image.stamp: Dockerfile
|
||||
|
||||
build-docker-image: build/build-docker-image.stamp
|
||||
|
||||
build/download-packages.stamp: build/build-docker-image.stamp src/download_packages.sh
|
||||
mkdir -p build/packages
|
||||
build/download-packages.stamp: build/build-docker-image.stamp src/compilation/download_packages.sh
|
||||
mkdir -p $(BUILD_PACKAGES_DIR)
|
||||
docker run --user $(shell id -u):$(shell id -g) \
|
||||
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
||||
/app/gdb/src/download_packages.sh /app/gdb/build/packages
|
||||
/app/gdb/src/compilation/download_packages.sh /app/gdb/$(BUILD_PACKAGES_DIR)/
|
||||
touch build/download-packages.stamp
|
||||
|
||||
build/symlink-git-packages.stamp: $(SUBMODULE_PACKAGES)
|
||||
mkdir -p $(BUILD_PACKAGES_DIR)
|
||||
ln -sf $(addprefix /app/gdb/, $(SUBMODULE_PACKAGES)) $(BUILD_PACKAGES_DIR)/
|
||||
|
||||
symlink-git-packages: build/symlink-git-packages.stamp
|
||||
|
||||
download-packages: build/download-packages.stamp
|
||||
|
||||
build: $(TARGETS)
|
||||
|
||||
$(TARGETS): build-%: download-packages build-docker-image
|
||||
$(TARGETS): build-%: symlink-git-packages download-packages build-docker-image
|
||||
mkdir -p build
|
||||
docker run --user $(shell id -u):$(shell id -g) \
|
||||
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
||||
/app/gdb/src/build.sh $* /app/gdb/build/ /app/gdb/src
|
||||
/app/gdb/src/compilation/build.sh $* /app/gdb/build/ /app/gdb/src
|
||||
|
||||
pack: $(PACK_TARGETS)
|
||||
|
||||
@ -47,7 +55,10 @@ $(PACK_TARGETS): pack-%: build-%
|
||||
tar -czf "build/artifacts/gdb-static-$*.tar.gz" -C "build/artifacts/$*" .; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
clean-git-packages:
|
||||
git submodule foreach '[[ ! "$$sm_path" == src/submodule_packages/* ]] || git clean -xffd'
|
||||
|
||||
clean: clean-git-packages
|
||||
rm -rf build
|
||||
# Kill and remove all containers of image gdb-static
|
||||
docker ps -a | grep -P "^[a-f0-9]+\s+gdb-static\s+" | awk '{print $$1}' | xargs docker rm -f 2>/dev/null || true
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit e201d7df36871dad439bd5162123f080397abb38
|
||||
Subproject commit d734d02f4ce9ca77aa6708bf5bd16429e147e9ef
|
Loading…
x
Reference in New Issue
Block a user