All pastes #897279 Raw Edit

Someone

public text v1 · immutable
#897279 ·published 2008-02-09 11:59 UTC
rendered paste body
Index: preamble.tex
===================================================================
--- preamble.tex	(revision 16248)
+++ preamble.tex	(working copy)
@@ -35,6 +35,7 @@
 \usepackage{optional}
 
 \input{platform/\platform.tex}
+\input{features.tex}
 
 \newcommand{\playername}{\playerman\ \playerlongtype}
 
Index: Makefile
===================================================================
--- Makefile	(revision 16248)
+++ Makefile	(working copy)
@@ -11,8 +11,10 @@
 .PHONY: all buildmanual clean
 MANFILE := rockbox-build
 
-all: manual-pdf 
+all: features 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,6 +27,14 @@
 	@printf "\\\\input{rockbox.tex}\n" >> $(OBJDIR)/$(MANFILE).tex
 	@mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
 
+$(OBJDIR)/features: $(ROOTDIR)/apps/features.txt
+	$(SILENT)mkdir -p `dirname $@`
+	$(SILENT)cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
+	$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "$(ROOTDIR)/firmware/export/config.h" -imacros "$(ROOTDIR)/firmware/export/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: manual-prep rockbox.tex
 	$(MAKE) -C $(OBJDIR) buildmanual