Commit FS#8567, the manual now uses the same 'features' system as the lang/voice creation does. Building the manual now requires gcc to parse the features list and 'make manual' must now be used instead of just 'make'. Rerun configure in your manual build dirs.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16304 a1c6a512-1295-4272-9138-f99709370657
diff --git a/manual/Makefile b/manual/Makefile
index 05df9ba..52f6bd5 100644
--- a/manual/Makefile
+++ b/manual/Makefile
@@ -7,12 +7,17 @@
 # $Id$
 #
 
+# Needed to build the features list.
+INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR)	\
+ -I$(BUILDDIR)/bitmaps -I$(OBJDIR)
 
 .PHONY: all buildmanual clean
 MANFILE := rockbox-build
 
 all: manual-pdf 
 
+features: $(OBJDIR)/features
+
 manual-prep: rockbox.tex
 	@if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
 	@mkdir -p $(OBJDIR)
@@ -25,7 +30,15 @@
 	@printf "\\\\input{rockbox.tex}\n" >> $(OBJDIR)/$(MANFILE).tex
 	@mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
 
-manual-pdf: manual-prep rockbox.tex
+$(OBJDIR)/features: $(ROOTDIR)/apps/features.txt
+	$(SILENT)mkdir -p `dirname $@`
+	$(SILENT)cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
+	$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" -imacros "button.h" - | \
+	grep -v "^\#" | grep -v "^$$" > $@; \
+	for f in `cat $(OBJDIR)/features`; do feat="$$feat\n\\\edef\\UseOption{\\UseOption,$$f}" ; done ; \
+	echo -e "$$feat" >$(OBJDIR)/features.tex
+
+manual-pdf: features manual-prep rockbox.tex
 	$(MAKE) -C $(OBJDIR) buildmanual
 
 manual-html: manual-prep rockbox.tex