提交 157e2849 编写于 作者: R Rich Felker

support clean/distclean make targets in unconfigured tree

commit 2f853dd6 moved the error
handling for $(ARCH) not being set such that it applied to all
targets, including clean and distclean. previously these targets
worked even in an unconfigured tree. to restore the old behavior, make
most of the makefile body conditional on $(ARCH) being set/non-empty
and produce the error via a fake "all" target in the conditional
branch for the case where $(ARCH) is empty.
上级 63bcda4d
......@@ -77,8 +77,12 @@ LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1
-include config.mak
ifeq ($(ARCH),)
$(error Please set ARCH in config.mak before running make.)
endif
all:
@echo "Please set ARCH in config.mak before running make."
@exit 1
else
all: $(ALL_LIBS) $(ALL_TOOLS)
......@@ -89,14 +93,6 @@ $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): |
$(OBJ_DIRS):
mkdir -p $@
install: install-libs install-headers install-tools
clean:
rm -rf obj lib
distclean: clean
rm -f config.mak
obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed
sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@
......@@ -223,10 +219,20 @@ install-headers: $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%)
install-tools: $(ALL_TOOLS:obj/%=$(DESTDIR)$(bindir)/%)
install: install-libs install-headers install-tools
musl-git-%.tar.gz: .git
git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ $(patsubst musl-git-%.tar.gz,%,$@)
musl-%.tar.gz: .git
git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ v$(patsubst musl-%.tar.gz,%,$@)
endif
clean:
rm -rf obj lib
distclean: clean
rm -f config.mak
.PHONY: all clean install install-libs install-headers install-tools
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册