< prev index next >

make/gensrc/GensrcMisc.gmk

Print this page




  53 
  54 ################################################################################
  55 
  56 ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
  57   # Need to specify language since the template file has a non standard
  58   # extension.
  59   CPP_FLAGS += -x c
  60 else ifeq ($(TOOLCHAIN_TYPE), microsoft)
  61   CPP_FLAGS += -nologo
  62 endif
  63 
  64 # Generate a java source file from a template through the C preprocessor for the
  65 # target system. First extract the copyright notice at the start of the file.
  66 # Run the preprocessor. Filter out the default compiler stderr output on
  67 # Windows. Filter out all the header files output. Remove all "PREFIX_" strings
  68 # that were added to variable references in the template files to avoid being
  69 # matched by the preprocessor. Remove any #line directives left by the
  70 # preprocessor.
  71 define generate-preproc-src
  72         $(call MakeDir, $(@D))
  73         $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_$(@F), \
  74             ( $(NAWK) '/@@END_COPYRIGHT@@/{exit}1' $< && \
  75               $(CPP) $(CPP_FLAGS) $(SYSROOT_CFLAGS) $(CFLAGS_JDKLIB) $< \
  76                   2> >($(GREP) -v '^$(<F)$$' >&2) \
  77                   | $(NAWK) '/@@START_HERE@@/,0' \
  78                   |  $(SED) -e 's/@@START_HERE@@/\/\/ AUTOMATICALLY GENERATED FILE - DO NOT EDIT/' \
  79                   -e 's/PREFIX_//' -e 's/^#.*//' \
  80             ) > $@ \
  81         )
  82 endef
  83 
  84 GENSRC_SOR_FILE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java
  85 
  86 $(GENSRC_SOR_FILE): \
  87     $(TOPDIR)/src/java.base/share/classes/sun/nio/ch/SocketOptionRegistry.java.template
  88         $(generate-preproc-src)
  89 
  90 GENSRC_JAVA_BASE += $(GENSRC_SOR_FILE)
  91 
  92 ################################################################################
  93 
  94 ifeq ($(call isTargetOs, windows), false)
  95 
  96   GENSRC_UC_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java
  97 
  98   $(GENSRC_UC_FILE): \
  99       $(TOPDIR)/src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template
 100         $(generate-preproc-src)
 101 




  53 
  54 ################################################################################
  55 
  56 ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
  57   # Need to specify language since the template file has a non standard
  58   # extension.
  59   CPP_FLAGS += -x c
  60 else ifeq ($(TOOLCHAIN_TYPE), microsoft)
  61   CPP_FLAGS += -nologo
  62 endif
  63 
  64 # Generate a java source file from a template through the C preprocessor for the
  65 # target system. First extract the copyright notice at the start of the file.
  66 # Run the preprocessor. Filter out the default compiler stderr output on
  67 # Windows. Filter out all the header files output. Remove all "PREFIX_" strings
  68 # that were added to variable references in the template files to avoid being
  69 # matched by the preprocessor. Remove any #line directives left by the
  70 # preprocessor.
  71 define generate-preproc-src
  72         $(call MakeDir, $(@D))
  73         ( $(NAWK) '/@@END_COPYRIGHT@@/{exit}1' $< && \
  74           $(CPP) $(CPP_FLAGS) $(SYSROOT_CFLAGS) $(CFLAGS_JDKLIB) $< \
  75               2> >($(GREP) -v '^$(<F)$$' >&2) \
  76               | $(NAWK) '/@@START_HERE@@/,0' \
  77               |  $(SED) -e 's/@@START_HERE@@/\/\/ AUTOMATICALLY GENERATED FILE - DO NOT EDIT/' \
  78               -e 's/PREFIX_//' -e 's/^#.*//' \
  79         ) > $@


  80 endef
  81 
  82 GENSRC_SOR_FILE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java
  83 
  84 $(GENSRC_SOR_FILE): \
  85     $(TOPDIR)/src/java.base/share/classes/sun/nio/ch/SocketOptionRegistry.java.template
  86         $(generate-preproc-src)
  87 
  88 GENSRC_JAVA_BASE += $(GENSRC_SOR_FILE)
  89 
  90 ################################################################################
  91 
  92 ifeq ($(call isTargetOs, windows), false)
  93 
  94   GENSRC_UC_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java
  95 
  96   $(GENSRC_UC_FILE): \
  97       $(TOPDIR)/src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template
  98         $(generate-preproc-src)
  99 


< prev index next >