Skip to content

Commit

Permalink
8218807: Compilation database (compile_commands.json) may contain obs…
Browse files Browse the repository at this point in the history
…olete items

Reviewed-by: ihse, erikj
  • Loading branch information
rwestberg committed Feb 12, 2019
1 parent 09ebff0 commit 30063b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 8 additions & 3 deletions make/Main.gmk
Expand Up @@ -784,6 +784,8 @@ else
$(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc))
$(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java))

$(COMPILE_COMMANDS_TARGETS_HOTSPOT): clean-compile-commands
$(COMPILE_COMMANDS_TARGETS_JDK): clean-compile-commands
compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)

Expand Down Expand Up @@ -1138,6 +1140,9 @@ clean: $(CLEAN_DIR_TARGETS)
clean-docs:
$(call CleanDocs)

clean-compile-commands:
$(call CleanMakeSupportDir,compile-commands)

$(CLEAN_DIR_TARGETS):
$(call CleanDir,$(patsubst clean-%, %, $@))

Expand Down Expand Up @@ -1179,9 +1184,9 @@ dist-clean: clean
)
$(ECHO) Cleaned everything, you will have to re-run configure.

ALL_TARGETS += clean clean-docs dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_SUPPORT_DIR_TARGETS) \
$(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) \
$(CLEAN_MODULE_PHASE_TARGETS)
ALL_TARGETS += clean clean-docs clean-compile-commands dist-clean $(CLEAN_DIR_TARGETS) \
$(CLEAN_SUPPORT_DIR_TARGETS) $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) \
$(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)

################################################################################
# Declare *-only targets for each normal target
Expand Down
7 changes: 7 additions & 0 deletions make/MainSupport.gmk
Expand Up @@ -65,6 +65,13 @@ define CleanSupportDir
@$(PRINTF) " done\n"
endef

define CleanMakeSupportDir
@$(PRINTF) "Cleaning $(strip $1) make support artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/$(strip $1)
@$(PRINTF) " done\n"
endef

define CleanTest
@$(PRINTF) "Cleaning test $(strip $1) ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
Expand Down

0 comments on commit 30063b9

Please sign in to comment.