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
This commit is contained in:
Dominik Riebeling 2011-11-05 10:53:10 +00:00
parent 767672df4c
commit 3a66005739

View file

@ -15,28 +15,42 @@ endif
INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
-I$(BUILDDIR)/bitmaps -I$(OBJDIR)
.PHONY: all buildmanual clean
.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
features: $(OBJDIR)/features.tex
manual-prep: rockbox.tex
objdir-check:
@if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
@mkdir -p $(OBJDIR)
@find * -type d \! -regex '.*\.svn.*' -exec mkdir -p $(OBJDIR)/{} \;
@find * -type f \! -regex '.*\.svn.*' -exec cp {} $(OBJDIR)/{} \;
@printf "%s%%" $(VERSION) > $(OBJDIR)/version.tex
@perl credits.pl < $(DOCSDIR)/CREDITS > $(OBJDIR)/CREDITS.tex
@printf "\\\\newcommand{\\\\platform}{${MANUALDEV}}\n" > $(OBJDIR)/$(MANFILE).tex
@printf "\\\\newcommand{\\\\buildversion}{$(VERSION)}\n" >> $(OBJDIR)/$(MANFILE).tex
@printf "\\\\input{rockbox.tex}\n" >> $(OBJDIR)/$(MANFILE).tex
@mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
$(OBJDIR)/features: $(ROOTDIR)/apps/features.txt
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) \
@ -45,22 +59,21 @@ $(OBJDIR)/features: $(ROOTDIR)/apps/features.txt
for f in `cat $(OBJDIR)/features`; do feat="$$feat\\n\\\\edef\\\\UseOption{\\\\UseOption,$$f}" ; done ; \
printf "$$feat" >$(OBJDIR)/features.tex
manual-pdf: features manual-prep rockbox.tex
$(MAKE) -C $(OBJDIR) buildmanual
manual-pdf: objdir-check features manual-prep rockbox.tex
$(SILENT)$(MAKE) -C $(OBJDIR) buildmanual
manual-html: features manual-prep rockbox.tex
$(MAKE) -C $(OBJDIR) buildhtml
manual-html: objdir-check features manual-prep rockbox.tex
$(SILENT)$(MAKE) -C $(OBJDIR) buildhtml
manual-txt: manual-html
$(MAKE) -C $(OBJDIR) buildtxt
$(SILENT)$(MAKE) -C $(OBJDIR) buildtxt
manual-txt-zip: manual-txt
$(MAKE) -C $(OBJDIR) txtzip
$(SILENT)$(MAKE) -C $(OBJDIR) txtzip
manual-zip: manual-html
$(MAKE) -C $(OBJDIR) htmlzip
$(SILENT)$(MAKE) -C $(OBJDIR) htmlzip
clean:
@if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
@rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf
@rm -rf $(OBJDIR)/html $(OBJDIR)/txt
clean: objdir-check
$(SILENT)rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf
$(SILENT)rm -rf $(OBJDIR)/html $(OBJDIR)/txt