Skip to content

Commit d68d466

Browse files
committed
Update Makefile.{singlesrc,multisrc} to use X_TARGET_FLAGS
The LNT test harness handles TARGET_FLAGS specially, and prevents other users of the variable from functioning as intended, i.e. "TARGET_FLAGS += -maltivec" does not work as intended. X_TARGET_FLAGS exists to work around this, but was not utilized in Makefile.{singlesrc,multisrc}. Update those makefiles to use X_TARGET_FLAGS, and update Altivec/Makefile appropriately. llvm-svn: 174712
1 parent aab1590 commit d68d466

File tree

3 files changed

+41
-39
lines changed

3 files changed

+41
-39
lines changed

MultiSource/Makefile.multisrc

+12-12
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,35 @@ NLObjects := $(addprefix Output/,$(NLObjs))
3131
.PRECIOUS: $(LObjects) $(NObjects) $(NLObjects)
3232

3333
Output/%.o: %.c Output/.dir
34-
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
34+
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
3535

3636
Output/%.o: %.C Output/.dir
37-
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
37+
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
3838

3939
Output/%.o: %.cpp Output/.dir
40-
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
40+
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
4141

4242
Output/%.o: %.cc Output/.dir
43-
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
43+
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
4444

4545
Output/%.llvm.o: %.c Output/.dir
4646
$(RUNSAFELYLOCAL) /dev/null $@.compile \
47-
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
47+
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
4848
Output/%.llvm.o: %.m Output/.dir
4949
$(RUNSAFELYLOCAL) /dev/null $@.compile \
50-
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
50+
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
5151
Output/%.llvm.o: %.C Output/.dir
5252
$(RUNSAFELYLOCAL) /dev/null $@.compile \
53-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
53+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
5454
Output/%.llvm.o: %.cpp Output/.dir
5555
$(RUNSAFELYLOCAL) /dev/null $@.compile \
56-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
56+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
5757
Output/%.llvm.o: %.cc Output/.dir
5858
$(RUNSAFELYLOCAL) /dev/null $@.compile \
59-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
59+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
6060
Output/%.llvm.o: %.mm Output/.dir
6161
$(RUNSAFELYLOCAL) /dev/null $@.compile \
62-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
62+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
6363

6464
bugpoint-opt: Output/$(PROG).bugpoint-opt
6565
bugpoint-gccas: Output/$(PROG).bugpoint-opt
@@ -89,10 +89,10 @@ BEGIN { real = 0.0; user = 0.0; sys = 0.0; }\
8989
/^user/ { user += $$2; }\
9090
/^sys/ { sys += $$2; }\
9191
END { printf("real %f\nuser %f\nsys %f\n", real, user, sys); }' > [email protected]
92-
-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $(NLObjects) $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
92+
-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $(NLObjects) $(LDFLAGS) $(CFLAGS) $(X_TARGET_FLAGS)
9393

9494
Output/%.native: $(NObjects) $(GeneratedTestInputs)
95-
-$(CXX) -o $@ $(NObjects) $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
95+
-$(CXX) -o $@ $(NObjects) $(LDFLAGS) $(CFLAGS) $(X_TARGET_FLAGS)
9696

9797
# A simple target to run findmisopt when bugpoint isn't helping
9898
findmisopt:

SingleSource/Makefile.singlesrc

+27-27
Original file line numberDiff line numberDiff line change
@@ -57,88 +57,88 @@ endif
5757

5858
Output/%.llvm.o: %.c Output/.dir
5959
$(RUNSAFELYLOCAL) /dev/null $@.compile \
60-
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
60+
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
6161
Output/%.llvm.o: %.m Output/.dir
6262
$(RUNSAFELYLOCAL) /dev/null $@.compile \
63-
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
63+
$(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
6464
Output/%.llvm.o: %.C Output/.dir
6565
$(RUNSAFELYLOCAL) /dev/null $@.compile \
66-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
66+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
6767
Output/%.llvm.o: %.cpp Output/.dir
6868
$(RUNSAFELYLOCAL) /dev/null $@.compile \
69-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
69+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
7070
Output/%.llvm.o: %.cc Output/.dir
7171
$(RUNSAFELYLOCAL) /dev/null $@.compile \
72-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
72+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
7373
Output/%.llvm.o: %.mm Output/.dir
7474
$(RUNSAFELYLOCAL) /dev/null $@.compile \
75-
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
75+
$(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) -c $< -o $@
7676
.PRECIOUS: Output/%.llvm.o
7777

7878
Output/%.simple: Output/%.llvm.o Output/.dir
7979
-$(CP) $<.compile.time $@.compile.time
80-
-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $< $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
80+
-$(LD_ENV_OVERRIDES) $(LCXX) -o $@ $< $(LDFLAGS) $(CFLAGS) $(X_TARGET_FLAGS)
8181

8282
# FIXME: LIBS should be specified, not hardcoded to -lm
8383
Output/%.native: $(SourceDir)/%.c Output/.dir
84-
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
84+
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
8585

8686
Output/%.native: $(SourceDir)/%.cpp Output/.dir
87-
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
87+
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
8888

8989
Output/%.native: $(SourceDir)/%.m Output/.dir
90-
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
90+
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
9191

9292
Output/%.native: $(SourceDir)/%.mm Output/.dir
93-
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
93+
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
9494

9595
Output/%.native.dbg: $(SourceDir)/%.c Output/.dir
96-
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
96+
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
9797

9898
Output/%.native.dbg: $(SourceDir)/%.cpp Output/.dir
99-
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
99+
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
100100

101101
Output/%.native.dbg: $(SourceDir)/%.m Output/.dir
102-
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
102+
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
103103

104104
Output/%.native.dbg: $(SourceDir)/%.mm Output/.dir
105-
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
105+
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
106106

107107
Output/%.native.dbg.opt: $(SourceDir)/%.c Output/.dir
108-
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
108+
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
109109

110110
Output/%.native.dbg.opt: $(SourceDir)/%.cpp Output/.dir
111-
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
111+
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
112112

113113
Output/%.native.dbg.opt: $(SourceDir)/%.m Output/.dir
114-
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
114+
-$(CC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
115115

116116
Output/%.native.dbg.opt: $(SourceDir)/%.mm Output/.dir
117-
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
117+
-$(CXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
118118

119119
Output/%.dbg: $(SourceDir)/%.c Output/.dir
120-
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
120+
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
121121

122122
Output/%.dbg: $(SourceDir)/%.cpp Output/.dir
123-
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
123+
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
124124

125125
Output/%.dbg: $(SourceDir)/%.m Output/.dir
126-
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
126+
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
127127

128128
Output/%.dbg: $(SourceDir)/%.mm Output/.dir
129-
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
129+
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
130130

131131
Output/%.dbg.opt: $(SourceDir)/%.c Output/.dir
132-
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
132+
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
133133

134134
Output/%.dbg.opt: $(SourceDir)/%.cpp Output/.dir
135-
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
135+
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
136136

137137
Output/%.dbg.opt: $(SourceDir)/%.m Output/.dir
138-
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
138+
-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
139139

140140
Output/%.dbg.opt: $(SourceDir)/%.mm Output/.dir
141-
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
141+
-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(X_TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
142142

143143
bugpoint-gccas bugpoint-opt bugpoint-jit bugpoint-llc bugpoint-llc-beta:
144144
@echo "The $@ target doesn't work in SingleSource. Try:"

SingleSource/UnitTests/Vector/Altivec/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ DIRS =
99
FP_TOLERANCE := 0.002
1010

1111
TARGET_FLAGS += -maltivec
12+
# setting TEST_TARGET_FLAGS is needed within the LNT environment.
13+
TEST_TARGET_FLAGS += -maltivec
1214
LCCFLAGS += -maltivec
1315

1416
include $(LEVEL)/SingleSource/Makefile.singlesrc

0 commit comments

Comments
 (0)