< prev index next >

make/modules/java.base/gensrc/GensrcMisc.gmk

Print this page
8248238: Adding Windows support to OpenJDK on AArch64

Summary: Adding Windows support for AArch64

Contributed-by: Ludovic Henry <luhenry@microsoft.com>, Monica Beckwith <monica.beckwith@microsoft.com>
Reviewed-by:

@@ -58,10 +58,14 @@
   # Need to specify language since the template file has a non standard
   # extension.
   CPP_FLAGS += -x c
 else ifeq ($(TOOLCHAIN_TYPE), microsoft)
   CPP_FLAGS += -nologo
+
+  # cl.exe does only recognize few file extensions as valid (ex: .c, .h, .cpp), so
+  # make sure *.java.template files are recognized as valid input files
+  CPP_FILEPREFIX = /Tc
 endif
 
 # Generate a java source file from a template through the C preprocessor for the
 # target system. First extract the copyright notice at the start of the file.
 # Run the preprocessor. Filter out the default compiler stderr output on

@@ -71,11 +75,11 @@
 # preprocessor.
 define generate-preproc-src
         $(call MakeDir, $(@D))
         $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_$(@F), \
             ( $(NAWK) '/@@END_COPYRIGHT@@/{exit}1' $< && \
-              $(CPP) $(CPP_FLAGS) $(SYSROOT_CFLAGS) $(CFLAGS_JDKLIB) $< \
+              $(CPP) $(CPP_FLAGS) $(SYSROOT_CFLAGS) $(CFLAGS_JDKLIB) $(CPP_FILEPREFIX) $< \
                   2> >($(GREP) -v '^$(<F)$$' >&2) \
                   | $(NAWK) '/@@START_HERE@@/,0' \
                   |  $(SED) -e 's/@@START_HERE@@/\/\/ AUTOMATICALLY GENERATED FILE - DO NOT EDIT/' \
                   -e 's/PREFIX_//' -e 's/^#.*//' \
             ) > $@ \
< prev index next >