From 58ecc3e589c2edc0ef4f33d4419b0b2e7ac6a83d Mon Sep 17 00:00:00 2001
From: Rob Landley <rob@landley.net>
Date: Thu, 10 Jan 2008 14:40:13 -0600
Subject: Move some generated files into the "generated" subdirectory.

---
 Makefile             | 18 +++++++++---------
 generated/README.txt |  3 +++
 toys.h               |  2 +-
 toys/help.c          |  2 +-
 4 files changed, 14 insertions(+), 11 deletions(-)
 create mode 100644 generated/README.txt

diff --git a/Makefile b/Makefile
index c70306bb..7e91ded4 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ include kconfig/Makefile
 # The long and roundabout sed is to make old versions of sed happy.  New ones
 # have '\n' so can replace one line with two without all the branches and
 # mucking about with hold space.
-gen_config.h: .config
+generated/gen_config.h: .config
 	sed -n -e 's/^# CONFIG_\(.*\) is not set.*/\1/' \
 	  -e 't notset' -e 'b tryisset' -e ':notset' \
 	  -e 'h' -e 's/.*/#define CFG_& 0/p' \
@@ -46,19 +46,19 @@ bloatcheck: toybox_old toybox_unstripped
 toyfiles = main.c lib/*.c \
 	$(shell scripts/cfg2files.sh < .config | sed 's@\(.*\)@toys/\1.c@')
 
-# The following still depends on toys/help.h even when it's not there, so *.h
-# isn't sufficient by itself.
+# The following still depends on generated/help.h even when it's not there, so
+# *.h isn't sufficient by itself.
 
-toybox_unstripped: gen_config.h $(toyfiles) toys/toylist.h toys/help.h toys/*.h lib/*.h toys.h
+toybox_unstripped: generated/gen_config.h generated/help.h $(toyfiles) toys/toylist.h toys/*.h lib/*.h toys.h
 	$(CC) $(CCFLAGS) -I . $(toyfiles) -o toybox_unstripped $(OPTIMIZE)
 
 toybox: toybox_unstripped
 	$(STRIP) toybox_unstripped -o toybox
 
-toys/help.c: toys/help.h
+toys/help.c: generated/help.h
 
-toys/help.h: Config.in toys/Config.in scripts/config2help.py
-	scripts/config2help.py Config.in > toys/help.h
+generated/help.h: Config.in toys/Config.in scripts/config2help.py
+	scripts/config2help.py Config.in > generated/help.h
 
 instlist: toybox
 	$(HOSTCC) $(CCFLAGS) -I . scripts/install.c -o instlist
@@ -69,10 +69,10 @@ install_flat: instlist
 	@for i in `./instlist`; do ln -s toybox "$(PREFIX)/$$i"; done
 
 clean::
-	rm -f toybox toybox_unstripped gen_config.h instlist
+	rm -f toybox toybox_unstripped generated/gen_config.h instlist
 
 distclean: clean
-	rm -f toybox_old .config* toys/help.h
+	rm -f toybox_old .config* generated/help.h
 
 test: tests
 
diff --git a/generated/README.txt b/generated/README.txt
new file mode 100644
index 00000000..e7b0325f
--- /dev/null
+++ b/generated/README.txt
@@ -0,0 +1,3 @@
+All the files in this directory except this README are generated by the
+build.  Some of them may require python on the host system, and are thus
+shipped in the build tarball so python isn't a build requirement.
diff --git a/toys.h b/toys.h
index 5ccec7d3..c54dbd6f 100644
--- a/toys.h
+++ b/toys.h
@@ -6,7 +6,7 @@
  * Licensed under GPL version 2, see file LICENSE in this tarball for details.
  */
 
-#include "gen_config.h"
+#include "generated/gen_config.h"
 
 #include "lib/portability.h"
 
diff --git a/toys/help.c b/toys/help.c
index 6dd7fb1c..42d06a8c 100644
--- a/toys/help.c
+++ b/toys/help.c
@@ -6,7 +6,7 @@
  */
 
 #include "toys.h"
-#include "toys/help.h"
+#include "generated/help.h"
 
 #undef NEWTOY
 #undef OLDTOY
-- 
cgit v1.2.3