changeset 232:cd4d5630c978

Move some generated files into the "generated" subdirectory.
author Rob Landley <rob@landley.net>
date Thu, 10 Jan 2008 14:40:13 -0600
parents 31dc682c18ad
children d4176f3f3835
files Makefile generated/README.txt toys.h toys/help.c
diffstat 4 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Jan 10 14:34:15 2008 -0600
+++ b/Makefile	Thu Jan 10 14:40:13 2008 -0600
@@ -26,7 +26,7 @@
 # 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 @@
 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 @@
 	@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
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generated/README.txt	Thu Jan 10 14:40:13 2008 -0600
@@ -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.
--- a/toys.h	Thu Jan 10 14:34:15 2008 -0600
+++ b/toys.h	Thu Jan 10 14:40:13 2008 -0600
@@ -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"
 
--- a/toys/help.c	Thu Jan 10 14:34:15 2008 -0600
+++ b/toys/help.c	Thu Jan 10 14:40:13 2008 -0600
@@ -6,7 +6,7 @@
  */
 
 #include "toys.h"
-#include "toys/help.h"
+#include "generated/help.h"
 
 #undef NEWTOY
 #undef OLDTOY