new tool
[hband-tools.git] / compiled-tools / coreutils / Makefile
blob8c4194a2a80be0a1bc89907a0cfa5c9d5a938b4f
2 SOURCEDIR = coreutils
3 CHMOD_OBJ_DEP_FILES = \
4 lib/configmake.h src/version.h lib/unused-parameter.h lib/sys/stat.h lib/string.h lib/time.h lib/fcntl.h \
5 lib/stdio.h lib/getopt.h lib/inttypes.h lib/stddef.h lib/stdlib.h lib/unistd.h lib/wchar.h
6 CHMOD_OBJ_DEPS = $(foreach file,$(CHMOD_OBJ_DEP_FILES),$(SOURCEDIR)/$(file))
9 SUPPORTED_COMMIT = 7945e09e7b1164cc463d6f6c2bb717211276df74
11 # if your sysstem defaults are too old
12 BOOTSTRAP_EXTRA_PATH=/usr/local/opt/gettext_0.19.6/bin
15 chmod-cheap: $(SOURCEDIR)/src/chmod
16 install $< $@
19 define make_coreutils_target
20 $(MAKE) -C $(SOURCEDIR) $(subst $(SOURCEDIR)/,,$@)
21 endef
23 define checkout_supported_commit
24 cd $(SOURCEDIR) && if [ $$(git show -s --format=%H) != $(SUPPORTED_COMMIT) ]; then git checkout $(SUPPORTED_COMMIT); fi
25 endef
28 $(SOURCEDIR)/src/chmod: $(SOURCEDIR)/src/chmod.o
29 $(make_coreutils_target)
31 $(SOURCEDIR)/src/chmod.o: $(SOURCEDIR)/src/chmod.c $(CHMOD_OBJ_DEPS)
32 $(make_coreutils_target)
34 $(SOURCEDIR)/src/chmod.c: $(SOURCEDIR)/.git/HEAD
35 $(checkout_supported_commit)
36 cd $(SOURCEDIR) && git checkout HEAD -- src/chmod.c
37 patch -d $(SOURCEDIR) -p1 -i ../chmod-cheap.patch -f
40 $(CHMOD_OBJ_DEPS): $(SOURCEDIR)/Makefile
41 $(make_coreutils_target)
43 $(SOURCEDIR)/Makefile: $(SOURCEDIR)/configure
44 cd $(SOURCEDIR) && ./configure
46 $(SOURCEDIR)/configure: $(SOURCEDIR)/bootstrap
47 $(checkout_supported_commit)
48 cd $(SOURCEDIR) && PATH=$(BOOTSTRAP_EXTRA_PATH):$$PATH ./bootstrap --skip-po
50 $(SOURCEDIR)/bootstrap: $(SOURCEDIR)/.git/HEAD
51 $(checkout_supported_commit)
52 touch $@
55 $(SOURCEDIR)/.git/HEAD: | $(SOURCEDIR)
56 $(checkout_supported_commit)
59 $(SOURCEDIR):
60 git clone git://git.sv.gnu.org/coreutils $(SOURCEDIR)
63 clean:
64 cd $(SOURCEDIR) && git checkout HEAD -- .
65 cd $(SOURCEDIR) && git clean -x -d -f
67 .PHONY: clean