Skip to content

Commit fa4c862

Browse files
committed
Workaround for hidden symbols in makefile.shared
1 parent e2fadbe commit fa4c862

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

etc/tune.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,8 @@ int main(int argc, char **argv)
728728
}
729729
/* TODO: add graphs for radix conversion, too? */
730730
if (args.print == 1) {
731-
printf("Printing data for graphing to \"%s\", \"%s\", \"%s\", and \"%s\"\n",mullog, sqrlog, rcreadlog, rcwritelog);
731+
printf("Printing up to %d datapoints for graphing to \"%s\", \"%s\", \"%s\", and \"%s\"\n",args.upper_limit_print,
732+
mullog, sqrlog, rcreadlog, rcwritelog);
732733

733734
multiplying = fopen(mullog, "w+");
734735
if (multiplying == NULL) {
@@ -756,7 +757,8 @@ int main(int argc, char **argv)
756757

757758

758759
for (x = 1; x < args.upper_limit_print; x += args.increment_print) {
759-
printf("\r%d", (rgs.upper_limit_print - x));
760+
printf("\r%d", x);
761+
fflush(stdout);
760762
set_cutoffs(&max_cutoffs);
761763
t1 = s_time_mul(x);
762764
set_cutoffs(&orig);

makefile.shared

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,56 @@ $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
9393
mtest:
9494
cd mtest ; $(CC) $(LTM_CFLAGS) -O0 mtest.c $(LTM_LDFLAGS) -o mtest
9595

96-
tune: $(LIBNAME)
96+
tuneold: $(LIBNAME)
9797
$(LTCOMPILE) $(LTM_CFLAGS) -c etc/tune.c -o etc/tune.o
9898
$(LTLINK) $(LTM_LDFLAGS) -o etc/tune etc/tune.o $(LIBNAME)
9999
cd etc/; /bin/sh tune_it.sh; cd ..
100100
$(MAKE) -f makefile.shared
101101

102+
tune:
103+
$(MAKE) -f makefile tune
104+
$(MAKE) -f makefile clean
105+
$(MAKE) -f makefile.shared
106+
102107

103-
graphs: $(LIBNAME)
108+
graphsold: $(LIBNAME)
104109
$(LTCOMPILE) $(LTM_CFLAGS) -c etc/tune.c -o etc/tune.o
105110
$(LTLINK) $(LTM_LDFLAGS) -o etc/tune etc/tune.o $(LIBNAME)
106111
$(LTCOMPILE) $(LTM_CFLAGS) -c etc/get_limbsize.c -o etc/get_limbsize.o
107112
$(LTLINK) $(LTM_LDFLAGS) -o etc/get_limbsize etc/get_limbsize.o $(LIBNAME)
108-
cd etc/
109-
/bin/sh tune_it.sh 2000
110-
gnuplot -c plot_graphs.gp `./get_limbsize`
113+
cd etc/;\
114+
/bin/sh tune_it.sh 2000;\
115+
gnuplot -c plot_graphs.gp `./get_limbsize`;\
116+
cd ..
117+
$(MAKE) -f makefile.shared
118+
119+
120+
# Most of the substitution tricks do not work in Posix make and/or shell
121+
# so we do it by hand. (Yes, it has to be in one line)
122+
graphs:
123+
$(MAKE) -f makefile graphs
124+
cd etc/;\
125+
/bin/mv multiplying.png multiplying.png_backup;\
126+
/bin/mv squaring.png squaring.png_backup;\
127+
/bin/mv readradix.png readradix.png_backup;\
128+
/bin/mv writeradix.png writeradix.png_backup;\
129+
/bin/mv multiplying multiplying_backup;\
130+
/bin/mv squaring squaring_backup;\
131+
/bin/mv readradix readradix_backup;\
132+
/bin/mv writeradix writeradix_backup;\
133+
cd ..
134+
$(MAKE) -f makefile clean
135+
cd etc/;\
136+
/bin/mv multiplying.png_backup multiplying.png;\
137+
/bin/mv squaring.png_backup squaring.png;\
138+
/bin/mv readradix.png_backup readradix.png;\
139+
/bin/mv writeradix.png_backup writeradix.png;\
140+
/bin/mv multiplying_backup multiplying;\
141+
/bin/mv squaring_backup squaring;\
142+
/bin/mv readradix_backup readradix;\
143+
/bin/mv writeradix_backup writeradix;\
111144
cd ..
112145
$(MAKE) -f makefile.shared
113146

114147

148+

0 commit comments

Comments
 (0)