1 #
   2 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #  
  23 #
  24 
  25 
  26 # Rules for building adlc.exe
  27 
  28 # Need exception handling support here
  29 # $(MS_RUNTIME_OPTION) ( with /D_STATIC_CPPLIB)
  30 # causes adlc.exe to link with the static
  31 # multithread Standard C++ library (libcpmt.lib) instead of
  32 # the dynamic version (msvcprt.lib), which is not included
  33 # in any of the free tools.
  34 EXH_FLAGS=$(GX_OPTION) $(MS_RUNTIME_OPTION)
  35 
  36 !ifdef ALT_ADLC_PATH
  37 ADLC=$(ALT_ADLC_PATH)\adlc.exe
  38 !else
  39 ADLC=adlc
  40 !endif
  41 
  42 !ifdef LP64
  43 ADLCFLAGS=-q -T -D_LP64
  44 !else
  45 ADLCFLAGS=-q -T -U_LP64
  46 !endif
  47 
  48 ADLC_CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
  49 
  50 CPP_INCLUDE_DIRS=\
  51   /I "..\generated" \
  52   /I "$(WorkSpace)\src\share\vm" \
  53   /I "$(WorkSpace)\src\os\windows\vm" \
  54   /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
  55 
  56 # NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR
  57 # and ProjectCreatorIDEOptions in projectcreator.make. 
  58 GENERATED_NAMES=\
  59   ad_$(Platform_arch_model).cpp \
  60   ad_$(Platform_arch_model).hpp \
  61   ad_$(Platform_arch_model)_clone.cpp \
  62   ad_$(Platform_arch_model)_expand.cpp \
  63   ad_$(Platform_arch_model)_format.cpp \
  64   ad_$(Platform_arch_model)_gen.cpp \
  65   ad_$(Platform_arch_model)_misc.cpp \
  66   ad_$(Platform_arch_model)_peephole.cpp \
  67   ad_$(Platform_arch_model)_pipeline.cpp \
  68   adGlobals_$(Platform_arch_model).hpp \
  69   dfa_$(Platform_arch_model).cpp
  70 
  71 # NOTE! This must be kept in sync with GENERATED_NAMES
  72 GENERATED_NAMES_IN_DIR=\
  73   $(AdlcOutDir)\ad_$(Platform_arch_model).cpp \
  74   $(AdlcOutDir)\ad_$(Platform_arch_model).hpp \
  75   $(AdlcOutDir)\ad_$(Platform_arch_model)_clone.cpp \
  76   $(AdlcOutDir)\ad_$(Platform_arch_model)_expand.cpp \
  77   $(AdlcOutDir)\ad_$(Platform_arch_model)_format.cpp \
  78   $(AdlcOutDir)\ad_$(Platform_arch_model)_gen.cpp \
  79   $(AdlcOutDir)\ad_$(Platform_arch_model)_misc.cpp \
  80   $(AdlcOutDir)\ad_$(Platform_arch_model)_peephole.cpp \
  81   $(AdlcOutDir)\ad_$(Platform_arch_model)_pipeline.cpp \
  82   $(AdlcOutDir)\adGlobals_$(Platform_arch_model).hpp \
  83   $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
  84 
  85 {$(WorkSpace)\src\share\vm\adlc}.cpp.obj::
  86         $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
  87 
  88 {$(WorkSpace)\src\share\vm\opto}.cpp.obj::
  89         $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
  90 
  91 adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \
  92           forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj
  93         $(LINK) $(LINK_FLAGS) /subsystem:console /out:$@ $**
  94 !if "$(MT)" != ""
  95 # The previous link command created a .manifest file that we want to
  96 # insert into the linked artifact so we do not need to track it
  97 # separately.  Use ";#2" for .dll and ";#1" for .exe:
  98         $(MT) /manifest $@.manifest /outputresource:$@;#1
  99 !endif
 100 
 101 $(GENERATED_NAMES_IN_DIR): $(Platform_arch_model).ad adlc.exe
 102         rm -f $(GENERATED_NAMES)
 103         if exist $(AdlcOutDir) rmdir /s /q $(AdlcOutDir)
 104         mkdir $(AdlcOutDir)
 105         $(ADLC) $(ADLCFLAGS) $(Platform_arch_model).ad
 106         mv $(GENERATED_NAMES) $(AdlcOutDir)/
 107 
 108 $(Platform_arch_model).ad: $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad
 109         rm -f $(Platform_arch_model).ad
 110         cat $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad  \
 111             $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad >$(Platform_arch_model).ad