rockbox/manual/Makefile
Dominik Riebeling 3a66005739 Rework manual Makefile a bit.
- move some stuff out of manual-prep and improve dependencies.
- always update version information, version.sh is run anyway.
- use $(SILENT) in more places to allow showing the commands.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30902 a1c6a512-1295-4272-9138-f99709370657
2011-11-05 10:53:10 +00:00

79 lines
2.7 KiB
Makefile

# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
ifndef V
SILENT=@
endif
# 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 objdir-check
MANFILE := rockbox-build
VERSION= `$(TOOLSDIR)/version.sh $(ROOTDIR)`
.PHONY: $(OBJDIR)/version.tex $(OBJDIR)/$(MANFILE).tex
all: manual-pdf
features: $(OBJDIR)/features.tex
objdir-check:
@if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
manual-prep: objdir-check rockbox.tex $(OBJDIR)/CREDITS.tex $(OBJDIR)/version.tex $(OBJDIR)/$(MANFILE).tex
$(SILENT)mkdir -p $(OBJDIR)
$(SILENT)find * -type d \! -regex '.*\.svn.*' -exec mkdir -p $(OBJDIR)/{} \;
$(SILENT)find * -type f \! -regex '.*\.svn.*' -exec cp {} $(OBJDIR)/{} \;
$(SILENT)mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
$(OBJDIR)/$(MANFILE).tex:
@echo "creating $(notdir $@)"
$(SILENT)printf "\\\\newcommand{\\\\platform}{${MANUALDEV}}\n" > $(OBJDIR)/$(MANFILE).tex
$(SILENT)printf "\\\\newcommand{\\\\buildversion}{$(VERSION)}\n" >> $(OBJDIR)/$(MANFILE).tex
$(SILENT)printf "\\\\input{rockbox.tex}\n" >> $(OBJDIR)/$(MANFILE).tex
$(OBJDIR)/CREDITS.tex: $(DOCSDIR)/CREDITS
@echo "processing $(notdir $^)"
$(SILENT)perl credits.pl < $(DOCSDIR)/CREDITS > $(OBJDIR)/CREDITS.tex
$(OBJDIR)/version.tex:
@echo "creating $(notdir $@)"
$(SILENT)printf "%s%%" $(VERSION) > $(OBJDIR)/version.tex
$(OBJDIR)/features.tex: $(ROOTDIR)/apps/features.txt
@echo "processing $(notdir $^)"
$(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 ; \
printf "$$feat" >$(OBJDIR)/features.tex
manual-pdf: objdir-check features manual-prep rockbox.tex
$(SILENT)$(MAKE) -C $(OBJDIR) buildmanual
manual-html: objdir-check features manual-prep rockbox.tex
$(SILENT)$(MAKE) -C $(OBJDIR) buildhtml
manual-txt: manual-html
$(SILENT)$(MAKE) -C $(OBJDIR) buildtxt
manual-txt-zip: manual-txt
$(SILENT)$(MAKE) -C $(OBJDIR) txtzip
manual-zip: manual-html
$(SILENT)$(MAKE) -C $(OBJDIR) htmlzip
clean: objdir-check
$(SILENT)rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf
$(SILENT)rm -rf $(OBJDIR)/html $(OBJDIR)/txt