adlc.make 4.3 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
19 20 21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
duke 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#  
#


# Rules for building adlc.exe

# Need exception handling support here
# $(MS_RUNTIME_OPTION) ( with /D_STATIC_CPPLIB)
# causes adlc.exe to link with the static
# multithread Standard C++ library (libcpmt.lib) instead of
# the dynamic version (msvcprt.lib), which is not included
# in any of the free tools.
EXH_FLAGS=$(GX_OPTION) $(MS_RUNTIME_OPTION)

!ifdef ALT_ADLC_PATH
ADLC=$(ALT_ADLC_PATH)\adlc.exe
!else
ADLC=adlc
!endif

!ifdef LP64
ADLCFLAGS=-q -T -D_LP64
!else
ADLCFLAGS=-q -T -U_LP64
!endif

48
ADLC_CXX_FLAGS=$(CXX_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
D
duke 已提交
49

50
CXX_INCLUDE_DIRS=\
51 52 53
  /I "..\generated" \
  /I "$(WorkSpace)\src\share\vm" \
  /I "$(WorkSpace)\src\os\windows\vm" \
D
duke 已提交
54 55
  /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"

56 57
!if "$(Platform_arch_model)" == "$(Platform_arch)"
SOURCES_AD=\
A
adlertz 已提交
58
  $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad 
59 60 61
!else
SOURCES_AD=\
  $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad \
A
adlertz 已提交
62
  $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad 
63 64
!endif

65 66
# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR
# and ProjectCreatorIDEOptions in projectcreator.make. 
D
duke 已提交
67 68 69 70 71 72 73 74 75 76 77 78 79 80
GENERATED_NAMES=\
  ad_$(Platform_arch_model).cpp \
  ad_$(Platform_arch_model).hpp \
  ad_$(Platform_arch_model)_clone.cpp \
  ad_$(Platform_arch_model)_expand.cpp \
  ad_$(Platform_arch_model)_format.cpp \
  ad_$(Platform_arch_model)_gen.cpp \
  ad_$(Platform_arch_model)_misc.cpp \
  ad_$(Platform_arch_model)_peephole.cpp \
  ad_$(Platform_arch_model)_pipeline.cpp \
  adGlobals_$(Platform_arch_model).hpp \
  dfa_$(Platform_arch_model).cpp

# NOTE! This must be kept in sync with GENERATED_NAMES
81 82 83 84 85 86 87 88 89 90 91 92
GENERATED_NAMES_IN_DIR=\
  $(AdlcOutDir)\ad_$(Platform_arch_model).cpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model).hpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model)_clone.cpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model)_expand.cpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model)_format.cpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model)_gen.cpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model)_misc.cpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model)_peephole.cpp \
  $(AdlcOutDir)\ad_$(Platform_arch_model)_pipeline.cpp \
  $(AdlcOutDir)\adGlobals_$(Platform_arch_model).hpp \
  $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
D
duke 已提交
93 94

{$(WorkSpace)\src\share\vm\adlc}.cpp.obj::
95
        $(CXX) $(ADLC_CXX_FLAGS) $(EXH_FLAGS) $(CXX_INCLUDE_DIRS) /c $<
D
duke 已提交
96 97

{$(WorkSpace)\src\share\vm\opto}.cpp.obj::
98
        $(CXX) $(ADLC_CXX_FLAGS) $(EXH_FLAGS) $(CXX_INCLUDE_DIRS) /c $<
D
duke 已提交
99 100 101

adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \
          forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj
102
	$(LD) $(LD_FLAGS) /subsystem:console /out:$@ $**
103 104 105 106 107 108
!if "$(MT)" != ""
# The previous link command created a .manifest file that we want to
# insert into the linked artifact so we do not need to track it
# separately.  Use ";#2" for .dll and ";#1" for .exe:
	$(MT) /manifest $@.manifest /outputresource:$@;#1
!endif
D
duke 已提交
109

110
$(GENERATED_NAMES_IN_DIR): $(Platform_arch_model).ad adlc.exe
D
duke 已提交
111
	rm -f $(GENERATED_NAMES)
112 113
	if exist $(AdlcOutDir) rmdir /s /q $(AdlcOutDir)
	mkdir $(AdlcOutDir)
D
duke 已提交
114
	$(ADLC) $(ADLCFLAGS) $(Platform_arch_model).ad
115
	mv $(GENERATED_NAMES) $(AdlcOutDir)/
D
duke 已提交
116

117
$(Platform_arch_model).ad: $(SOURCES_AD)
D
duke 已提交
118
	rm -f $(Platform_arch_model).ad
119
	cat $(SOURCES_AD) >$(Platform_arch_model).ad