Skip to content

Commit

Permalink
Create "clean_residual_files" target in Makefile (elixir-lang#5982)
Browse files Browse the repository at this point in the history
Additionally:

- Add /lib/*/_build/ to .gitignore, and delete folders

- Remove erl_crash.dump file in

- Mix fixtures
  - add lib/mix/test/fixtures/git_sparse_repo to the list of dirs to be removed
  - Sort and add a reminder in lib/mix/test/fixtures/.gitignore
    to update Makefile clean target when modifications are done
  • Loading branch information
eksperimental authored and josevalim committed Apr 17, 2017
1 parent d6f6163 commit 9c5d5e4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/doc
/ebin
/lib/*/ebin/*
/lib/*/ebin/
/lib/*/_build/
/lib/*/tmp
/lib/elixir/src/*_parser.erl
/lib/elixir/src/elixir.app.src
Expand Down
24 changes: 16 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ INSTALL_PROGRAM = $(INSTALL) -m755
GIT_REVISION = $(strip $(shell git rev-parse HEAD 2> /dev/null ))
GIT_TAG = $(strip $(shell head="$(call GIT_REVISION)"; git tag --points-at $$head 2> /dev/null | tail -1) )

.PHONY: install compile erlang elixir build_plt clean_plt dialyze test clean install_man clean_man docs Docs.zip Precompiled.zip zips
.PHONY: install compile erlang elixir build_plt clean_plt dialyze test clean clean_residual_files install_man clean_man docs Docs.zip Precompiled.zip zips
.NOTPARALLEL: compile

#==> Functions
Expand Down Expand Up @@ -116,17 +116,25 @@ clean:
cd lib/elixir && $(REBAR) clean
rm -rf ebin
rm -rf lib/*/ebin
rm -rf lib/elixir/test/ebin
rm -rf lib/*/tmp
rm -rf lib/mix/test/fixtures/git_repo
rm -rf lib/mix/test/fixtures/deps_on_git_repo
rm -rf lib/mix/test/fixtures/git_rebar
rm -rf lib/elixir/src/elixir.app.src
$(MAKE) clean_man
rm -f Docs-v*.zip
rm -f Precompiled-v*.zip
$(Q) $(MAKE) clean_residual_files

clean_exbeam:
$(Q) rm -f lib/*/ebin/Elixir.*.beam

clean_residual_files:
rm -rf lib/*/_build/
rm -rf lib/*/tmp/
rm -rf lib/elixir/test/ebin/
rm -rf lib/mix/test/fixtures/deps_on_git_repo/
rm -rf lib/mix/test/fixtures/git_rebar/
rm -rf lib/mix/test/fixtures/git_repo/
rm -rf lib/mix/test/fixtures/git_sparse_repo/
rm -f erl_crash.dump
$(Q) $(MAKE) clean_man

#==> Documentation tasks

LOGO_PATH = $(shell test -f ../docs/logo.png && echo "--logo ../docs/logo.png")
Expand Down Expand Up @@ -170,7 +178,7 @@ docs_logger: compile ../ex_doc/bin/ex_doc
@ echo "ex_doc is not found in ../ex_doc as expected. See README for more information."
@ false

#==> Zips
#==> Zips tasks

Docs.zip: docs
rm -rf Docs-v$(VERSION).zip
Expand Down
10 changes: 6 additions & 4 deletions lib/mix/test/fixtures/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
git_repo
git_sparse_repo
deps_on_git_repo
git_rebar
# Remember to update Makefile "clean_residual_files" target for any modifications
# made in this file
/deps_on_git_repo/
/git_rebar/
/git_repo/
/git_sparse_repo/

0 comments on commit 9c5d5e4

Please sign in to comment.