mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-20 07:36:39 +00:00
Makefile: Add wget-abc target
`make wget-abc` will attempt to download abc release archive for most recent yosys tag. This should provide a solution when downloading yosys from release tarballs. May have issues if executing in a non-git repository state on a development version if an updated abc version is expected.
This commit is contained in:
parent
ba01dfbde6
commit
bacfe127c4
18
Makefile
18
Makefile
|
@ -790,11 +790,29 @@ check-git-abc:
|
|||
echo "3. Initialize the submodule: Run 'git submodule update --init' to set up 'abc' as a submodule."; \
|
||||
echo "4. Reapply your changes: Move your saved changes back to the 'abc' directory, if necessary."; \
|
||||
exit 1; \
|
||||
elif git status 2>&1 | grep 'fatal: not a git repository'; then \
|
||||
echo "Did 'yosys' come from a release tarball? Try call 'make wget-abc' to download matching 'abc' tarball."; \
|
||||
exit 1; \
|
||||
else \
|
||||
echo "Initialize the submodule: Run 'git submodule update --init' to set up 'abc' as a submodule."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
.PHONY: wget-abc
|
||||
ABC_TAR := abc.tar.gz
|
||||
YOSYS_TAG := $(word 1,$(subst +, ,$(YOSYS_VER)))
|
||||
ABC_TAR_URL := https://github.com/YosysHQ/yosys/releases/download/yosys-$(YOSYS_TAG)/$(ABC_TAR)
|
||||
wget-abc:
|
||||
@if [ -z "$$(find abc -type d -prune -empty 2>&1)" ]; then \
|
||||
echo "Error: The 'abc' directory already has contents. Clear 'abc' directory before continuing."; \
|
||||
exit 1; \
|
||||
else \
|
||||
mkdir -p abc; \
|
||||
wget -nc "$(ABC_TAR_URL)"; \
|
||||
echo "Extracting '$(ABC_TAR)' contents."; \
|
||||
tar xzf $(ABC_TAR) -C abc --strip-components=1; \
|
||||
fi
|
||||
|
||||
abc/abc$(EXE) abc/libabc.a: check-git-abc
|
||||
$(P)
|
||||
$(Q) mkdir -p abc && $(MAKE) -C $(PROGRAM_PREFIX)abc -f "$(realpath $(YOSYS_SRC)/abc/Makefile)" ABCSRC="$(realpath $(YOSYS_SRC)/abc/)" $(S) $(ABCMKARGS) $(if $(filter %.a,$@),PROG="abc",PROG="abc$(EXE)") MSG_PREFIX="$(eval P_OFFSET = 5)$(call P_SHOW)$(eval P_OFFSET = 10) ABC: " $(if $(filter %.a,$@),libabc.a)
|
||||
|
|
Loading…
Reference in a new issue