-# 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
####
-# Set this to either `stdio' or `libio', to compile in either GNU stdio
-# or GNU libio.
-ifndef stdio
-stdio = stdio
-endif
-
# Common prefix for machine-independent installation directories.
ifeq ($(origin prefix),undefined) # ifndef would override explicit empty value.
prefix = /usr/local
# Where to install the header files.
ifndef includedir
-includedir = $(exec_prefix)/include
+includedir = $(prefix)/include
endif
inst_includedir = $(install_root)$(includedir)
# This is how to find at build-time things that will be installed there.
rpath-dirs = math elf dlfcn nss nis rt resolv crypt
else
-ifneq (,$(findstring aix,$(config-os)))
+ifneq (,$(filter aix aix%,$(config-os)))
link-libc = $(common-objpfx)libc.a \
$(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
rpath-dirs = math dlfcn nss nis rt resolv crypt
LDFLAGS-rdynamic = -rdynamic
LDFLAGS-Bsymbolic = -Bsymbolic
else
-ifneq (,$(findstring aix,$(config-os)))
+ifneq (,$(filter aix aix%,$(config-os)))
LDFLAGS-rpath-ORIGIN =
LDFLAGS-soname-fname =
LDFLAGS-rdynamic = -Wl,-bdynamic
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
$(filter -Wl$(comma)-rpath-link=%,\
$(sysdep-LDFLAGS)))))
-run-program-prefix = $(if $(findstring $(notdir $(built-program-file)), $(tests-static)),, \
+run-program-prefix = $(if $(filter $(notdir $(built-program-file)),\
+ $(tests-static)),, \
$(elf-objpfx)$(rtld-installed-name) \
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
else
+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.
# `+sysdep-includes' will be defined by Makerules.
+includes = -I$(..)include -I. \
$(patsubst %/,-I%,$(objpfx)) $(patsubst %/,-I%,$(..)) \
- $($(stdio)-include) $(includes) \
- $(+sysdep-includes) $(last-includes) $(sysincludes)
+ $(libio-include) $(includes) \
+ $(+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))
-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')
# (but no commands).
%.v.i: $(common-objpfx)config.h
sed '/^[ ]*#/d;s/^[ ]*%/#/' $(filter-out FORCE %.h,$^) \
- | $(CC) -E -undef -I$(common-objdir) -I$(..)include \
- -include $(common-objpfx)config.h \
+ | $(CC) -E -undef $(CPPFLAGS) \
-DASSEMBLER -x assembler-with-cpp - \
> $@T
mv -f $@T $@
$(add-ons) \
$(subdirs)))
$(common-objpfx)soversions.i: $(common-objpfx)shlib-versions.v
+ default_setname='$(filter-out %_default,$(oldest-abi:%=GLIBC_%))'; \
while read conf version setname; do \
test -n "$$version" && \
test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \
if test "x$$version" = xDEFAULT; then \
default_setname="$$setname"; \
else \
+ $(abi-default_setname) \
lib=`echo $$version | sed 's/=.*$$//'`; \
if eval test -z "\$${versioned_$${lib}}"; then \
eval versioned_$${lib}=yes; \
# dependencies. Only the $(binfmt-subdir) should always be kept at the
# end of the list.
all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
- stdlib stdio-common $(stdio) malloc string wcsmbs time dirent \
+ stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow po argp \
crypt $(add-ons) nss localedata timezone rt conform debug \
endif # Makeconfig not yet included
+
+# Local Variables:
+# mode: makefile
+# End: