Mercurial > hg > graal-compiler
comparison make/bsd/makefiles/rules.make @ 4891:719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
Summary: Cleaned up make variables for compilers and linker to consistently use CXX for C++ compiler, CC for C compiler and LD for linker.
Reviewed-by: dholmes, ohrstrom
author | erikj |
---|---|
date | Mon, 06 Feb 2012 09:14:22 +0100 |
parents | f08d439fab8c |
children | b9a9ed0f8eeb |
comparison
equal
deleted
inserted
replaced
4890:c77d473e71f7 | 4891:719f7007c8e8 |
---|---|
25 # Common rules/macros for the vm, adlc. | 25 # Common rules/macros for the vm, adlc. |
26 | 26 |
27 # Tell make that .cpp is important | 27 # Tell make that .cpp is important |
28 .SUFFIXES: .cpp $(SUFFIXES) | 28 .SUFFIXES: .cpp $(SUFFIXES) |
29 | 29 |
30 # For now. Other makefiles use CPP as the c++ compiler, but that should really | |
31 # name the preprocessor. | |
32 ifeq ($(CCC),) | |
33 CCC = $(CPP) | |
34 endif | |
35 | |
36 DEMANGLER = c++filt | 30 DEMANGLER = c++filt |
37 DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@ | 31 DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@ |
38 | 32 |
39 # $(CC) is the c compiler (cc/gcc), $(CCC) is the c++ compiler (CC/g++). | 33 # $(CC) is the c compiler (cc/gcc), $(CXX) is the c++ compiler (CC/g++). |
40 C_COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) | 34 CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS) |
41 CC_COMPILE = $(CCC) $(CPPFLAGS) $(CFLAGS) | 35 CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS) |
42 | 36 |
43 AS.S = $(AS) $(ASFLAGS) | 37 AS.S = $(AS) $(ASFLAGS) |
44 | 38 |
45 COMPILE.c = $(C_COMPILE) -c | 39 COMPILE.CC = $(CC_COMPILE) -c |
46 GENASM.c = $(C_COMPILE) -S | 40 GENASM.CC = $(CC_COMPILE) -S |
47 LINK.c = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS) | 41 LINK.CC = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS) |
48 LINK_LIB.c = $(CC) $(LFLAGS) $(SHARED_FLAG) | 42 LINK_LIB.CC = $(CC) $(LFLAGS) $(SHARED_FLAG) |
49 PREPROCESS.c = $(C_COMPILE) -E | 43 PREPROCESS.CC = $(CC_COMPILE) -E |
50 | 44 |
51 COMPILE.CC = $(CC_COMPILE) -c | 45 COMPILE.CXX = $(CXX_COMPILE) -c |
52 GENASM.CC = $(CC_COMPILE) -S | 46 GENASM.CXX = $(CXX_COMPILE) -S |
53 LINK.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS) | 47 LINK.CXX = $(CXX) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS) |
54 LINK_NOPROF.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS) | 48 LINK_NOPROF.CXX = $(CXX) $(LFLAGS) $(AOUT_FLAGS) |
55 LINK_LIB.CC = $(CCC) $(LFLAGS) $(SHARED_FLAG) | 49 LINK_LIB.CXX = $(CXX) $(LFLAGS) $(SHARED_FLAG) |
56 PREPROCESS.CC = $(CC_COMPILE) -E | 50 PREPROCESS.CXX = $(CXX_COMPILE) -E |
57 | 51 |
58 # cross compiling the jvm with c2 requires host compilers to build | 52 # cross compiling the jvm with c2 requires host compilers to build |
59 # adlc tool | 53 # adlc tool |
60 | 54 |
61 HOST.CC_COMPILE = $(HOSTCPP) $(CPPFLAGS) $(CFLAGS) | 55 HOST.CXX_COMPILE = $(HOSTCXX) $(CXXFLAGS) $(CFLAGS) |
62 HOST.COMPILE.CC = $(HOST.CC_COMPILE) -c | 56 HOST.COMPILE.CXX = $(HOST.CXX_COMPILE) -c |
63 HOST.LINK_NOPROF.CC = $(HOSTCPP) $(LFLAGS) $(AOUT_FLAGS) | 57 HOST.LINK_NOPROF.CXX = $(HOSTCXX) $(LFLAGS) $(AOUT_FLAGS) |
64 | 58 |
65 | 59 |
66 # Effect of REMOVE_TARGET is to delete out-of-date files during "gnumake -k". | 60 # Effect of REMOVE_TARGET is to delete out-of-date files during "gnumake -k". |
67 REMOVE_TARGET = rm -f $@ | 61 REMOVE_TARGET = rm -f $@ |
68 | |
69 # Synonyms. | |
70 COMPILE.cpp = $(COMPILE.CC) | |
71 GENASM.cpp = $(GENASM.CC) | |
72 LINK.cpp = $(LINK.CC) | |
73 LINK_LIB.cpp = $(LINK_LIB.CC) | |
74 PREPROCESS.cpp = $(PREPROCESS.CC) | |
75 | 62 |
76 # Note use of ALT_BOOTDIR to explicitly specify location of java and | 63 # Note use of ALT_BOOTDIR to explicitly specify location of java and |
77 # javac; this is the same environment variable used in the J2SE build | 64 # javac; this is the same environment variable used in the J2SE build |
78 # process for overriding the default spec, which is BOOTDIR. | 65 # process for overriding the default spec, which is BOOTDIR. |
79 # Note also that we fall back to using JAVA_HOME if neither of these is | 66 # Note also that we fall back to using JAVA_HOME if neither of these is |
159 # The non-PIC object files are only generated for 32 bit platforms. | 146 # The non-PIC object files are only generated for 32 bit platforms. |
160 ifdef LP64 | 147 ifdef LP64 |
161 %.o: %.cpp | 148 %.o: %.cpp |
162 @echo Compiling $< | 149 @echo Compiling $< |
163 $(QUIETLY) $(REMOVE_TARGET) | 150 $(QUIETLY) $(REMOVE_TARGET) |
164 $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) | 151 $(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) |
165 else | 152 else |
166 %.o: %.cpp | 153 %.o: %.cpp |
167 @echo Compiling $< | 154 @echo Compiling $< |
168 $(QUIETLY) $(REMOVE_TARGET) | 155 $(QUIETLY) $(REMOVE_TARGET) |
169 $(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \ | 156 $(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \ |
170 $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \ | 157 $(subst $(VM_PICFLAG), ,$(COMPILE.CXX)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \ |
171 $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)) | 158 $(COMPILE.CXX) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)) |
172 endif | 159 endif |
173 | 160 |
174 %.o: %.s | 161 %.o: %.s |
175 @echo Assembling $< | 162 @echo Assembling $< |
176 $(QUIETLY) $(REMOVE_TARGET) | 163 $(QUIETLY) $(REMOVE_TARGET) |
177 $(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) | 164 $(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) |
178 | 165 |
179 %.s: %.cpp | 166 %.s: %.cpp |
180 @echo Generating assembly for $< | 167 @echo Generating assembly for $< |
181 $(QUIETLY) $(GENASM.CC) -o $@ $< | 168 $(QUIETLY) $(GENASM.CXX) -o $@ $< |
182 $(QUIETLY) $(DEMANGLE) $(COMPILE_DONE) | 169 $(QUIETLY) $(DEMANGLE) $(COMPILE_DONE) |
183 | 170 |
184 # Intermediate files (for debugging macros) | 171 # Intermediate files (for debugging macros) |
185 %.i: %.cpp | 172 %.i: %.cpp |
186 @echo Preprocessing $< to $@ | 173 @echo Preprocessing $< to $@ |
187 $(QUIETLY) $(PREPROCESS.CC) $< > $@ $(COMPILE_DONE) | 174 $(QUIETLY) $(PREPROCESS.CXX) $< > $@ $(COMPILE_DONE) |
188 | 175 |
189 # Override gnumake built-in rules which do sccs get operations badly. | 176 # Override gnumake built-in rules which do sccs get operations badly. |
190 # (They put the checked out code in the current directory, not in the | 177 # (They put the checked out code in the current directory, not in the |
191 # directory of the original file.) Since this is a symptom of a teamware | 178 # directory of the original file.) Since this is a symptom of a teamware |
192 # failure, and since not all problems can be detected by gnumake due | 179 # failure, and since not all problems can be detected by gnumake due |