make/idea/idea.gmk
author chegar
Tue, 10 May 2016 13:34:30 +0100
changeset 37861 53d85619d7fe
child 37976 9cc5debe0f47
permissions -rw-r--r--
8074716: IntelliJ IDEA project support Reviewed-by: rriggs Contributed-by: Chris Hegarty <chris.hegarty@oracle.com>, Maurizio Cimadamore <maurizio.cimadamore@oracle.com>
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)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    38
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    39
endif