summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorJim Meyering <meyering@lucent.com>1992-02-10 05:19:38 +0000
committerJim Meyering <meyering@lucent.com>1992-02-10 05:19:38 +0000
commit64d20717d73d109efe2cf73e7f85a3a90f198ba2 (patch)
tree2fdc57018e744bfc84e622204479f348520a81b8 /math
parent6c66fe86c1eac18d4fbfdef03bc97e98d7a2c737 (diff)
Initial revision
Diffstat (limited to 'math')
-rw-r--r--math/Makefile98
1 files changed, 98 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile
new file mode 100644
index 0000000000..d6937cc014
--- /dev/null
+++ b/math/Makefile
@@ -0,0 +1,98 @@
+# Copyright (C) 1991 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+
+# You should have received a copy of the GNU Library General Public
+# License along with the GNU C Library; see the file COPYING.LIB. If
+# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+# Cambridge, MA 02139, USA.
+
+#
+# Makefile for math.
+#
+subdir := math
+
+headers := math.h __math.h
+
+
+routines := acos asin atan cos sin tan cosh sinh tanh exp fabs ldexp \
+ log log10 floor sqrt fmod frexp pow atan2 ceil modf \
+ isinf isnan finite infnan copysign scalb drem logb \
+ __isinf __isnan __finite __infnan __copysign __scalb __drem __logb\
+ rint hypot cabs cbrt expm1 log1p acosh asinh atanh
+
+
+include ../Rules
+
+
+# Other dirs to look for source files (for dist).
+source_dirs = $(filter-out unused,$(shell find bsd -type d -print))
+
+ifdef bsdmath_dirs
+
+override CPPFLAGS := $(CPPFLAGS) -Ibsd $(addprefix -Ibsd/,$(bsdmath_dirs))
+
++bsdpath := $(subst $+ ,:,bsd $(addprefix bsd/,$(bsdmath_dirs)))
+vpath %.s $(+bsdpath)
+vpath %.h $(+bsdpath)
+
++bsdfiles := $(wildcard $(patsubst %,bsd/%/*.c,$(bsdmath_dirs)))
+
+ifdef +bsdfiles
+
+# Find all the files which have both BSD and sysdep versions.
++sysdeps := $(notdir $(wildcard \
+ $(foreach dir, \
+ $(filter-out %/generic %/stub, \
+ $(+sysdep_dirs)), \
+ $(addprefix $(dir)/, \
+ $(notdir $(+bsdfiles))))))
+
+# Filter these out of the list of BSD files.
++bsdfiles := $(filter-out $(addprefix %/,$(+sysdeps)),$(+bsdfiles))
+
+# Assert that all the BSD C sources exist in the object directory,
+# so VPATH will find them there first.
+$(addprefix $(objpfx),$(notdir $(+bsdfiles))):
+
+# See how easy this would be in make v4?
+ifneq (,)
+define bsd-files
+$(foreach dir,$(bsdmath_dirs),
+$(objpfx)%.c: bsd/$(dir)/%.c
+ (echo '#include <ansidecl.h>'; echo '#include "$<") > $@-tmp
+ mv $@-tmp $@
+endef
+$(bsd-files)
+endif
+
+include $(objpfx)BSDmath-files
+$(objpfx)BSDmath-files: Makefile $(+bsdfiles)
+ (echo define +ansideclificate-bsd; \
+ echo "(echo '#include <ansidecl.h>'; \
+ echo '#include \"\$$<\"') > \$$@-tmp; \
+ mv \$$@-tmp \$$@"; \
+ echo endef; \
+ for dir in $(bsdmath_dirs); do \
+ echo "\$$(objpfx)%.c: bsd/$${dir}/%.c;\$$(+ansideclificate-bsd)";\
+ done) > $@-tmp
+ mv $@-tmp $@
+
+ifneq ($(findstring gcc,$(CC)),)
+# Disable GCC warnings for grody BSD code.
+override CFLAGS := $(filter-out -W%,$(CFLAGS))
+# In make v4, put "$(+bsdfiles): " in front of that.
+endif
+
+endif # +bsdfiles
+
+endif # bsdmath_dirs