Skip to content


Browse files Browse the repository at this point in the history
Makefile: add 'clean_crystal' target (#4268)
It is useful in compiler development cycle.

    $ vim src/...  # edit compiler sources (but incomplete)
    $ make crystal # oops! maked incompilable compiler...
    $ make crystal # failed because compiler does not work

At such time I don't want to use `make clean` because it removes
`libcrystal` and `llvmext` also. I don't want to build C++ files
again, so I added `clean-crystal` target in Makefile. It removes
the files built by `crystal` command. Now, we can use
`make clean_crystal crystal` to recompile `crystal` after removing
compiler itself.
  • Loading branch information
makenowjust authored and Martin Verzilli committed Jun 2, 2017
1 parent 2c8fead commit cc16950
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Expand Up @@ -123,8 +123,11 @@ $(LIB_CRYSTAL_TARGET): $(LIB_CRYSTAL_OBJS)
$(AR) -rcs $@ $^

.PHONY: clean
clean: ## Clean up built directories and files
rm -rf $(O)
rm -rf ./doc
clean: clean_crystal ## Clean up built directories and files
rm -rf $(LLVM_EXT_OBJ)

.PHONY: clean_crystal
clean_crystal: ## Clean up crystal built files
rm -rf $(O)
rm -rf ./doc

0 comments on commit cc16950

Please sign in to comment.