-# Copyright (C) 1991-2000,01,02 Free Software Foundation, Inc.
+# Copyright (C) 1991-2000,01,02, 03 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
# Where to install the header files.
ifndef includedir
-includedir = $(exec_prefix)/include
+includedir = $(prefix)/include
endif
inst_includedir = $(install_root)$(includedir)
+gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes
endif
-# This is the program that generates makefile
-# dependencies from C source files.
+# This is the program that generates makefile dependencies from C source files.
+# The -MP flag tells GCC >= 3.2 (which we now require) to produce dummy
+# targets for headers so that removed headers don't break the build.
ifndef +mkdep
-+mkdep = $(CC) -M
++mkdep = $(CC) -M -MP
endif
# The program that makes Emacs-style TAGS files.
+includes = -I$(..)include -I. \
$(patsubst %/,-I%,$(objpfx)) $(patsubst %/,-I%,$(..)) \
$(libio-include) $(includes) \
- $(+sysdep-includes) $(last-includes) $(sysincludes)
+ $(+sysdep-includes) $(sysincludes)
# Since libio has several internal header files, we use a -I instead
# of many little headers in the include directory.
libio-include = -I$(..)libio
# These are the variables that the implicit compilation rules use.
+# Note that we can't use -std=* in CPPFLAGS, because it overrides
+# the implicit -lang-asm and breaks cpp behavior for .S files--notably
+# it causes cpp to stop predefining __ASSEMBLER__.
CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
-include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
- $(CPPFLAGS-$(suffix $@)) $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) \
- $(CPPFLAGS-$(patsubst %$(suffix $@),%,$(@F)))
-override CFLAGS = $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
+ $(CPPFLAGS-$(suffix $@)) \
+ $(foreach lib,$(libof-$(basename $(@F))) \
+ $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
+ $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
+override CFLAGS = -std=gnu99 \
+ $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
$(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
# If everything is compiled with -fPIC (implicitly) we must tell this by
# shared objects. We don't want to use CFLAGS-os because users may, for
# example, make that processor-specific.
CFLAGS-.oS = $(CFLAGS-.o) $(pic-ccflag)
-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC
+CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
libtype.oS = lib%_nonshared.a
endif
+# The assembler can generate debug information too.
+ifndef ASFLAGS
+ifeq ($(have-cpp-asm-debuginfo),yes)
+ASFLAGS := $(filter -g%,$(CFLAGS))
+endif
+endif
+gnu-stabs = $(shell echo>&2 '*** BARF ON ME')