comparison make/jvmci.make @ 21917:0df6a0cb4b5f

Cleanup code in mx_graal_makefile.py, add comments
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Thu, 11 Jun 2015 11:35:27 +0200
parents 3df76a0300f3
children 35961ae3486f
comparison
equal deleted inserted replaced
21916:3df76a0300f3 21917:0df6a0cb4b5f
21 endif 21 endif
22 ifeq ($(MAKE_VERBOSE),) 22 ifeq ($(MAKE_VERBOSE),)
23 QUIETLY=@ 23 QUIETLY=@
24 endif 24 endif
25 25
26 # Takes the option files of the options annotation processor and merges them into a single file
27 # Arguments:
28 # 1: directory with contents of the JAR file
26 define process_options 29 define process_options
27 $(eval providers=$(1)/$(PROVIDERS_INF)) 30 $(eval providers=$(1)/$(PROVIDERS_INF))
28 $(eval services=$(1)/$(SERVICES_INF)) 31 $(eval services=$(1)/$(SERVICES_INF))
29 $(eval options=$(1)/$(OPTIONS_INF)) 32 $(eval options=$(1)/$(OPTIONS_INF))
30 $(QUIETLY) test -d $(services) || mkdir -p $(services) 33 $(QUIETLY) test -d $(services) || mkdir -p $(services)
35 $(eval vmconfig=$(1)/hotspot/HotSpotVMConfig.inline.hpp) 38 $(eval vmconfig=$(1)/hotspot/HotSpotVMConfig.inline.hpp)
36 $(eval vmconfigDest=$(HS_COMMON_SRC)/../jvmci/com.oracle.jvmci.hotspot/src_gen/hotspot) 39 $(eval vmconfigDest=$(HS_COMMON_SRC)/../jvmci/com.oracle.jvmci.hotspot/src_gen/hotspot)
37 $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) 40 $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest))
38 endef 41 endef
39 42
43 # Extracts META-INF/services and META-INF/options of a JAR file into a given directory
44 # Arguments:
45 # 1: JAR file to extract
46 # 2: target directory
40 define extract 47 define extract
41 $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX)) 48 $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX))
42 $(QUIETLY) mkdir -p $(2); 49 $(QUIETLY) mkdir -p $(2);
43 $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \ 50 $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \
44 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))); 51 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2))));
45 $(QUIETLY) rm -r $(TMP); 52 $(QUIETLY) rm -r $(TMP);
46 $(QUIETLY) cp $(1) $(2); 53 $(QUIETLY) cp $(1) $(2);
47 endef 54 endef
48 55
56 # Calls $(JAVAC) with the bootclasspath $(JDK_BOOTCLASSPATH); sources are taken from the automatic variable $?
57 # Arguments:
58 # 1: processorpath
59 # 2: classpath
60 # 3: resources to copy
61 # 4: target JAR file
49 define build_and_jar 62 define build_and_jar
50 $(info Building $(4)) 63 $(info Building $(4))
51 $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX)) 64 $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX))
52 $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$?); 65 $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$?);
53 $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP); 66 $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP);