about summary refs log tree commit diff
path: root/sysdeps/generic/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/Makefile')
-rw-r--r--sysdeps/generic/Makefile18
1 files changed, 16 insertions, 2 deletions
diff --git a/sysdeps/generic/Makefile b/sysdeps/generic/Makefile
index 972d469737..d741864b9c 100644
--- a/sysdeps/generic/Makefile
+++ b/sysdeps/generic/Makefile
@@ -1,5 +1,4 @@
-# Copyright (C) 1992,93,94,95,96,97,99,2002,2005
-#	Free Software Foundation, Inc.
+# Copyright (C) 1992,93,94,95,96,97,99,2002 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
@@ -17,6 +16,21 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 # 02111-1307 USA.
 
+ifeq (,$(filter-out $(sysdep_dir)/generic/bits $(common-objpfx)/bits,\
+	$(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/endian.h))))))
+
+$(common-objpfx)bytesex.h: $(common-objpfx)det_endian
+	$(dir $<)$(notdir $<) > $@-tmp
+	mv $@-tmp $@
+
+$(common-objpfx)det_endian: $(sysdep_dir)/generic/det_endian.c
+	$(common-objdir-compile)
+
+before-compile := $(before-compile) $(common-objpfx)bits/endian.h
+common-generated := $(common-generated) bits/endian.h det_endian
+
+endif
+
 ifeq ($(subdir),string)
 CFLAGS-wordcopy.c += -Wno-uninitialized
 endif