Wed, 01 Dec 2010 03:12:35 -0800
7003456: ADLC files not correctly generated on Windows
Summary: Added target architecture parameters to make ADLC build properly
Reviewed-by: never, stefank
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 #
25 !include $(WorkSpace)/make/windows/makefiles/compile.make
27 # Rules for building adlc.exe
29 # Need exception handling support here
30 # $(MS_RUNTIME_OPTION) ( with /D_STATIC_CPPLIB)
31 # causes adlc.exe to link with the static
32 # multithread Standard C++ library (libcpmt.lib) instead of
33 # the dynamic version (msvcprt.lib), which is not included
34 # in any of the free tools.
35 EXH_FLAGS=$(GX_OPTION) $(MS_RUNTIME_OPTION)
37 !ifdef ALT_ADLC_PATH
38 ADLC=$(ALT_ADLC_PATH)\adlc.exe
39 !else
40 ADLC=adlc
41 !endif
43 !ifdef LP64
44 ADLCFLAGS=-q -T -D_LP64
45 !else
46 ADLCFLAGS=-q -T -U_LP64
47 !endif
49 CPP_FLAGS=$(CPP_FLAGS) \
50 /D TARGET_OS_FAMILY_windows \
51 /D TARGET_ARCH_$(Platform_arch) \
52 /D TARGET_ARCH_MODEL_$(Platform_arch_model) \
53 /D TARGET_OS_ARCH_windows_$(Platform_arch) \
54 /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model) \
55 /D TARGET_COMPILER_visCPP
57 CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
59 CPP_INCLUDE_DIRS=\
60 /I "..\generated" \
61 /I "$(WorkSpace)\src\share\vm" \
62 /I "$(WorkSpace)\src\os\windows\vm" \
63 /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
65 # NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR
66 # and ProjectCreatorIDEOptions in projectcreator.make.
67 GENERATED_NAMES=\
68 ad_$(Platform_arch_model).cpp \
69 ad_$(Platform_arch_model).hpp \
70 ad_$(Platform_arch_model)_clone.cpp \
71 ad_$(Platform_arch_model)_expand.cpp \
72 ad_$(Platform_arch_model)_format.cpp \
73 ad_$(Platform_arch_model)_gen.cpp \
74 ad_$(Platform_arch_model)_misc.cpp \
75 ad_$(Platform_arch_model)_peephole.cpp \
76 ad_$(Platform_arch_model)_pipeline.cpp \
77 adGlobals_$(Platform_arch_model).hpp \
78 dfa_$(Platform_arch_model).cpp
80 # NOTE! This must be kept in sync with GENERATED_NAMES
81 GENERATED_NAMES_IN_DIR=\
82 $(AdlcOutDir)\ad_$(Platform_arch_model).cpp \
83 $(AdlcOutDir)\ad_$(Platform_arch_model).hpp \
84 $(AdlcOutDir)\ad_$(Platform_arch_model)_clone.cpp \
85 $(AdlcOutDir)\ad_$(Platform_arch_model)_expand.cpp \
86 $(AdlcOutDir)\ad_$(Platform_arch_model)_format.cpp \
87 $(AdlcOutDir)\ad_$(Platform_arch_model)_gen.cpp \
88 $(AdlcOutDir)\ad_$(Platform_arch_model)_misc.cpp \
89 $(AdlcOutDir)\ad_$(Platform_arch_model)_peephole.cpp \
90 $(AdlcOutDir)\ad_$(Platform_arch_model)_pipeline.cpp \
91 $(AdlcOutDir)\adGlobals_$(Platform_arch_model).hpp \
92 $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
94 {$(WorkSpace)\src\share\vm\adlc}.cpp.obj::
95 $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
97 {$(WorkSpace)\src\share\vm\opto}.cpp.obj::
98 $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
100 adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \
101 forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj
102 $(LINK) $(LINK_FLAGS) /subsystem:console /out:$@ $**
103 !if "$(MT)" != ""
104 # The previous link command created a .manifest file that we want to
105 # insert into the linked artifact so we do not need to track it
106 # separately. Use ";#2" for .dll and ";#1" for .exe:
107 $(MT) /manifest $@.manifest /outputresource:$@;#1
108 !endif
110 $(GENERATED_NAMES_IN_DIR): $(Platform_arch_model).ad adlc.exe
111 rm -f $(GENERATED_NAMES)
112 if exist $(AdlcOutDir) rmdir /s /q $(AdlcOutDir)
113 mkdir $(AdlcOutDir)
114 $(ADLC) $(ADLCFLAGS) $(Platform_arch_model).ad
115 mv $(GENERATED_NAMES) $(AdlcOutDir)/
117 $(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
118 rm -f $(Platform_arch_model).ad
119 cat $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad \
120 $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad >$(Platform_arch_model).ad