make/idea/idea.gmk
author prr
Tue, 14 Nov 2017 12:07:55 -0800
changeset 47839 314ac2e2db63
parent 37976 9cc5debe0f47
child 48667 f2344724a475
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37861
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     1
include Makefile
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     2
include make/MainSupport.gmk
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     3
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     4
.PHONY: idea
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     5
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     6
ifeq ($(SPEC),)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     7
  ifneq ($(words $(SPECS)),1)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     8
	@echo "Error: Multiple build specification files found. Please select one explicitly."
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     9
	@exit 2
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    10
  endif
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    11
  idea:
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    12
	@cd $(topdir)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    13
	@$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/idea/idea.gmk SPEC=$(SPECS) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) MODULES="$(MODULES)" idea
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    14
else #with SPEC
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    15
  include make/common/Modules.gmk
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    16
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    17
  ifeq ($(MODULES),)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    18
    SEL_MODULES := $(call FindAllModules)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    19
  else
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    20
    SEL_MODULES := $(MODULES)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    21
  endif
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    22
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    23
  # Find all source dirs for a particular module
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    24
  # $1 - Module to find source dirs for
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    25
  FindIdeaModuleSrcDirs = \
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    26
    $(strip $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    27
        $(wildcard $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    28
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    29
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    30
  idea:
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    31
	$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    32
	$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindIdeaModuleSrcDirs,$(mod)))\"" >> $(OUT)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    33
	$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    34
	$(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    35
	$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    36
	$(ECHO) "CYGPATH=\"$(CYGPATH)\"" >> $(OUT)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    37
	$(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
37976
9cc5debe0f47 8157061: Add support for running jtreg tests from IntelliJ project
mcimadamore
parents: 37861
diff changeset
    38
	$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)
37861
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    39
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    40
endif