Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ build-all: $(VERSIONS)
done

.PHONY: $(VERSIONS)
$(VERSIONS):
$(VERSIONS): copy_md_files
VERSION="$@" $(script_env) $(build)

.PHONY: test check
Expand Down Expand Up @@ -127,7 +127,7 @@ betka:
$(script_env) $(betka)

.PHONY: clean clean-hook clean-images clean-versions
clean: clean-images
clean: remove_md_files clean-images
@$(MAKE) --no-print-directory clean-hook

clean-images:
Expand All @@ -136,6 +136,25 @@ clean-images:
clean-versions:
rm -rf $(VERSIONS)

# Copy also all .md files from version directory to the root of
# container images, so that they are available in the image
# Currently there is only README.md, but there may be more in the future
copy_md_files:
@for version in $(VERSIONS); do \
mkdir -p "$$version/root" ; \
if ls $$version/*.md 1> /dev/null 2>&1; then \
cp -v $$version/*.md "$$version/root" ; \
chmod a+r $$version/root/*.md ; \
fi ; \
done

remove_md_files:
@for version in $(VERSIONS); do \
if ls $$version/*.md 1> /dev/null 2>&1; then \
rm -v $$version/root/*.md ; \
fi ; \
done

generate-all: generate

.PHOHY: generate
Expand Down
Loading