The MinGW.org Windows System Libraries
Revision | 63e9ed5552c5c99df5d049544f9bda9e5e0d84df (tree) |
---|---|
Time | 2014-01-28 07:13:35 |
Author | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Re-establish pattern rules for %_generic.c; (cf. issue #2175)
--HG--
rename : src/libcrt/math/asinh.c => src/libcrt/math/asinh_generic.c
@@ -1,3 +1,26 @@ | ||
1 | +2014-01-27 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Re-establish pattern rules for %_generic.c; (cf. issue #2175) | |
4 | + | |
5 | + * src/libcrt/math/round.c: Delete it; this kludgey stub isn't needed. | |
6 | + * src/libcrt/math/roundf.c src/libcrt/math/roundl.c: Likewise. | |
7 | + * src/libcrt/math/lround.c src/libcrt/math/lroundf.c: Likewise. | |
8 | + * src/libcrt/math/lroundl.c: Likewise. | |
9 | + | |
10 | + * src/libcrt/math/asinh.c: Rename to... | |
11 | + * src/libcrt/math/asinh_generic.c: ...this; compliance with the | |
12 | + math_generic.c naming convention is imperative. | |
13 | + | |
14 | + * src/libcrt/math/round_generic.c: Reinstate author attribution. | |
15 | + * src/libcrt/math/lround_generic.c: Likewise. | |
16 | + | |
17 | + * Makefile.in (math_SOURCES): Remove references to deleted files; add | |
18 | + references to corresponding %_generic.c sources, in their place. | |
19 | + (libmingwex_a_OBJECTS): Filter %_generic references, to generate the | |
20 | + corresponding %.o, %f.o, and %l.o references; append llround%.o set. | |
21 | + Adjust pattern rules to build each set of three; add a static pattern | |
22 | + rule, to accommodate special requirements of the llround% set. | |
23 | + | |
1 | 24 | 2014-01-22 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 25 | |
3 | 26 | Reinstate complex math functions; (cf. issue #2174) |
@@ -364,7 +364,7 @@ math_SOURCES := \ | ||
364 | 364 | $(SRCDIR)/acoshl.c \ |
365 | 365 | $(SRCDIR)/acosl.c \ |
366 | 366 | $(SRCDIR)/asinf.c \ |
367 | - $(SRCDIR)/asinh.c \ | |
367 | + $(SRCDIR)/asinh_generic.c \ | |
368 | 368 | $(SRCDIR)/asinl.c \ |
369 | 369 | $(SRCDIR)/atan2f.c \ |
370 | 370 | $(SRCDIR)/atan2l.c \ |
@@ -454,9 +454,7 @@ math_SOURCES := \ | ||
454 | 454 | $(SRCDIR)/lrint.c \ |
455 | 455 | $(SRCDIR)/lrintf.c \ |
456 | 456 | $(SRCDIR)/lrintl.c \ |
457 | - $(SRCDIR)/lround.c \ | |
458 | - $(SRCDIR)/lroundl.c \ | |
459 | - $(SRCDIR)/lroundf.c \ | |
457 | + $(SRCDIR)/lround_generic.c \ | |
460 | 458 | $(SRCDIR)/modff.c \ |
461 | 459 | $(SRCDIR)/modfl.c \ |
462 | 460 | $(SRCDIR)/nearbyint.S \ |
@@ -481,9 +479,7 @@ math_SOURCES := \ | ||
481 | 479 | $(SRCDIR)/rint.c \ |
482 | 480 | $(SRCDIR)/rintf.c \ |
483 | 481 | $(SRCDIR)/rintl.c \ |
484 | - $(SRCDIR)/round.c \ | |
485 | - $(SRCDIR)/roundf.c \ | |
486 | - $(SRCDIR)/roundl.c \ | |
482 | + $(SRCDIR)/round_generic.c \ | |
487 | 483 | $(MSRCDIR)/s_erf.c \ |
488 | 484 | $(SRCDIR)/scalbn.S \ |
489 | 485 | $(SRCDIR)/scalbnf.S \ |
@@ -620,11 +616,13 @@ libmingwex_a_SOURCES := \ | ||
620 | 616 | $(wchar_SOURCES) \ |
621 | 617 | $(wctype_SOURCES) |
622 | 618 | libmingwex_a_OBJECTS := $(libmingwex_a_SOURCES:.c=.o) |
623 | -libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:.S=.o) | |
624 | - | |
625 | -SRCDIR := src/libcrt/math | |
626 | -libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS) $(SRCDIR)/asinhl.o | |
627 | -libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS) $(SRCDIR)/asinhf.o | |
619 | +libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:.S=.o) \ | |
620 | + src/libcrt/math/llround_generic.o | |
621 | +libmingwex_a_generic_objects := $(filter %_generic.o,$(libmingwex_a_OBJECTS)) | |
622 | +libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:%_generic.o=%.o) \ | |
623 | + $(libmingwex_a_generic_objects:%_generic.o=%f.o) \ | |
624 | + $(libmingwex_a_generic_objects:%_generic.o=%l.o) | |
625 | +libmingwex_a_OBJECTS := $(sort $(libmingwex_a_OBJECTS)) | |
628 | 626 | |
629 | 627 | SRCDIR := misc/src/libdinput |
630 | 628 | libdinput_a_SOURCES := \ |
@@ -755,14 +753,30 @@ lib%.a: src/lib%/%.o | ||
755 | 753 | $(MKDIR_P) $(@D) |
756 | 754 | $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $< |
757 | 755 | |
756 | +# For the math sources, we support the convention that a single | |
757 | +# quux_generic.c source file will produce three objects: quux.o, | |
758 | +# quuxf.o, and quuxl.o; since a change in the common source file | |
759 | +# will require all three objects to be recompiled, we may handle | |
760 | +# this with a single, multiple target, pattern rule. | |
761 | +# | |
758 | 762 | SRCDIR := src/libcrt/math |
759 | -$(SRCDIR)/%f.o: $(SRCDIR)/%.c | |
763 | +$(SRCDIR)/%.o $(SRCDIR)/%f.o $(SRCDIR)/%l.o: $(SRCDIR)/%_generic.c | |
760 | 764 | $(MKDIR_P) $(@D) |
761 | - $(CC) -c -D FUNCTION=$(@F:.o=) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $< | |
762 | - | |
763 | -$(SRCDIR)/%l.o: $(SRCDIR)/%.c | |
765 | + $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*.o $< | |
766 | + $(CC) -c -D FUNCTION=$*f $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*f.o $< | |
767 | + $(CC) -c -D FUNCTION=$*l $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*l.o $< | |
768 | + | |
769 | +# The llround.o, llroundf.o, and llroundl.o variants are a special | |
770 | +# case of the preceding rule; (the source is lround_generic.c rather | |
771 | +# than llround_generic.c). We can handle this using the following | |
772 | +# static pattern rule, (again, compiling all three objects). | |
773 | +# | |
774 | +$(SRCDIR)/llroundf.o $(SRCDIR)/llroundl.o: $(SRCDIR)/llround.o | |
775 | +$(SRCDIR)/llround.o: $(SRCDIR)/%.o: $(SRCDIR)/lround_generic.c | |
764 | 776 | $(MKDIR_P) $(@D) |
765 | - $(CC) -c -D FUNCTION=$(@F:.o=) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $< | |
777 | + $(CC) -c -D FUNCTION=$* $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $< | |
778 | + $(CC) -c -D FUNCTION=$*f $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*f.o $< | |
779 | + $(CC) -c -D FUNCTION=$*l $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*l.o $< | |
766 | 780 | |
767 | 781 | SRCDIR := src/libcrt/crt |
768 | 782 | $(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o: |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /** |
2 | - * @file asinh.c | |
2 | + * @file asinh_generic.c | |
3 | 3 | * Copyright 2012, 2013 MinGW.org project |
4 | 4 | * |
5 | 5 | * Permission is hereby granted, free of charge, to any person obtaining a |
@@ -1,25 +0,0 @@ | ||
1 | -/** | |
2 | - * @file lround.c | |
3 | - * Copyright 2012, 2013 MinGW.org project | |
4 | - * | |
5 | - * Permission is hereby granted, free of charge, to any person obtaining a | |
6 | - * copy of this software and associated documentation files (the "Software"), | |
7 | - * to deal in the Software without restriction, including without limitation | |
8 | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
9 | - * and/or sell copies of the Software, and to permit persons to whom the | |
10 | - * Software is furnished to do so, subject to the following conditions: | |
11 | - * | |
12 | - * The above copyright notice and this permission notice (including the next | |
13 | - * paragraph) shall be included in all copies or substantial portions of the | |
14 | - * Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
22 | - * DEALINGS IN THE SOFTWARE. | |
23 | - */ | |
24 | -#define FUNCTION lround | |
25 | -#include "lround_generic.c" |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | * @file lround_generic.c |
3 | - * Copyright 2012, 2013 MinGW.org project | |
3 | + * Copyright 2008, 2012-2014 MinGW.org Project | |
4 | 4 | * |
5 | 5 | * Permission is hereby granted, free of charge, to any person obtaining a |
6 | 6 | * copy of this software and associated documentation files (the "Software"), |
@@ -21,13 +21,16 @@ | ||
21 | 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
22 | 22 | * DEALINGS IN THE SOFTWARE. |
23 | 23 | */ |
24 | - | |
25 | 24 | /* |
25 | + * Written by Keith Marshall <keithmarshall@users.sourceforge.net> | |
26 | + * | |
27 | + * | |
26 | 28 | * Provides a generic implementation for the `lround()', `lroundf()', |
27 | 29 | * `lroundl()', `llround()', `llroundf()' and `llroundl()' functions; |
28 | 30 | * compile with `-D FUNCTION=name', with `name' set to each of these |
29 | 31 | * six in turn, to create separate object files for each of the six |
30 | 32 | * functions. |
33 | + * | |
31 | 34 | */ |
32 | 35 | #ifndef FUNCTION |
33 | 36 | /* |
@@ -1,25 +0,0 @@ | ||
1 | -/** | |
2 | - * @file lroundf.c | |
3 | - * Copyright 2012, 2013 MinGW.org project | |
4 | - * | |
5 | - * Permission is hereby granted, free of charge, to any person obtaining a | |
6 | - * copy of this software and associated documentation files (the "Software"), | |
7 | - * to deal in the Software without restriction, including without limitation | |
8 | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
9 | - * and/or sell copies of the Software, and to permit persons to whom the | |
10 | - * Software is furnished to do so, subject to the following conditions: | |
11 | - * | |
12 | - * The above copyright notice and this permission notice (including the next | |
13 | - * paragraph) shall be included in all copies or substantial portions of the | |
14 | - * Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
22 | - * DEALINGS IN THE SOFTWARE. | |
23 | - */ | |
24 | -#define FUNCTION lroundf | |
25 | -#include "lround_generic.c" |
@@ -1,25 +0,0 @@ | ||
1 | -/** | |
2 | - * @file lroundl.c | |
3 | - * Copyright 2012, 2013 MinGW.org project | |
4 | - * | |
5 | - * Permission is hereby granted, free of charge, to any person obtaining a | |
6 | - * copy of this software and associated documentation files (the "Software"), | |
7 | - * to deal in the Software without restriction, including without limitation | |
8 | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
9 | - * and/or sell copies of the Software, and to permit persons to whom the | |
10 | - * Software is furnished to do so, subject to the following conditions: | |
11 | - * | |
12 | - * The above copyright notice and this permission notice (including the next | |
13 | - * paragraph) shall be included in all copies or substantial portions of the | |
14 | - * Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
22 | - * DEALINGS IN THE SOFTWARE. | |
23 | - */ | |
24 | -#define FUNCTION lroundl | |
25 | -#include "lround_generic.c" |
@@ -1,25 +0,0 @@ | ||
1 | -/** | |
2 | - * @file round.c | |
3 | - * Copyright 2012, 2013 MinGW.org project | |
4 | - * | |
5 | - * Permission is hereby granted, free of charge, to any person obtaining a | |
6 | - * copy of this software and associated documentation files (the "Software"), | |
7 | - * to deal in the Software without restriction, including without limitation | |
8 | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
9 | - * and/or sell copies of the Software, and to permit persons to whom the | |
10 | - * Software is furnished to do so, subject to the following conditions: | |
11 | - * | |
12 | - * The above copyright notice and this permission notice (including the next | |
13 | - * paragraph) shall be included in all copies or substantial portions of the | |
14 | - * Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
22 | - * DEALINGS IN THE SOFTWARE. | |
23 | - */ | |
24 | -#define FUNCTION round | |
25 | -#include "round_generic.c" |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | * @file round_generic.c |
3 | - * Copyright 2012, 2013 MinGW.org project | |
3 | + * Copyright 2008, 2012-2014 MinGW.org Project | |
4 | 4 | * |
5 | 5 | * Permission is hereby granted, free of charge, to any person obtaining a |
6 | 6 | * copy of this software and associated documentation files (the "Software"), |
@@ -21,12 +21,15 @@ | ||
21 | 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
22 | 22 | * DEALINGS IN THE SOFTWARE. |
23 | 23 | */ |
24 | - | |
25 | 24 | /* |
25 | + * Written by Keith Marshall <keithmarshall@users.sourceforge.net> | |
26 | + * | |
27 | + * | |
26 | 28 | * Provides a generic implementation for the `round()', `roundf()' |
27 | 29 | * and `roundl()' functions; compile with `-D FUNCTION=name', with |
28 | 30 | * `name' set to each of these three in turn, to create separate |
29 | 31 | * object files for each of the three functions. |
32 | + * | |
30 | 33 | */ |
31 | 34 | #ifndef FUNCTION |
32 | 35 | /* |
@@ -1,25 +0,0 @@ | ||
1 | -/** | |
2 | - * @file roundf.c | |
3 | - * Copyright 2012, 2013 MinGW.org project | |
4 | - * | |
5 | - * Permission is hereby granted, free of charge, to any person obtaining a | |
6 | - * copy of this software and associated documentation files (the "Software"), | |
7 | - * to deal in the Software without restriction, including without limitation | |
8 | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
9 | - * and/or sell copies of the Software, and to permit persons to whom the | |
10 | - * Software is furnished to do so, subject to the following conditions: | |
11 | - * | |
12 | - * The above copyright notice and this permission notice (including the next | |
13 | - * paragraph) shall be included in all copies or substantial portions of the | |
14 | - * Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
22 | - * DEALINGS IN THE SOFTWARE. | |
23 | - */ | |
24 | -#define FUNCTION roundf | |
25 | -#include "round_generic.c" |
@@ -1,25 +0,0 @@ | ||
1 | -/** | |
2 | - * @file roundl.c | |
3 | - * Copyright 2012, 2013 MinGW.org project | |
4 | - * | |
5 | - * Permission is hereby granted, free of charge, to any person obtaining a | |
6 | - * copy of this software and associated documentation files (the "Software"), | |
7 | - * to deal in the Software without restriction, including without limitation | |
8 | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
9 | - * and/or sell copies of the Software, and to permit persons to whom the | |
10 | - * Software is furnished to do so, subject to the following conditions: | |
11 | - * | |
12 | - * The above copyright notice and this permission notice (including the next | |
13 | - * paragraph) shall be included in all copies or substantial portions of the | |
14 | - * Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
22 | - * DEALINGS IN THE SOFTWARE. | |
23 | - */ | |
24 | -#define FUNCTION roundl | |
25 | -#include "round_generic.c" |