blob: de86edef5add4cf2b310a35ef1dea1d927f4d3b8 [file] [log] [blame]
Dominik Riebelingcb9fdf72007-01-14 23:29:15 +00001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
Dominik Riebeling6de815b2007-01-15 17:45:04 +00007# $Id$
Dominik Riebelingcb9fdf72007-01-14 23:29:15 +00008#
9
Nils Wallménius22a5c602008-02-13 16:40:57 +000010# Needed to build the features list.
11INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
12 -I$(BUILDDIR)/bitmaps -I$(OBJDIR)
Dominik Riebeling49af12a2007-06-21 15:35:47 +000013
Martin Arvere425c8e2006-03-16 11:05:22 +000014.PHONY: all buildmanual clean
Dominik Riebeling49af12a2007-06-21 15:35:47 +000015MANFILE := rockbox-build
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000016
Rafaël Carrécdc42452010-05-30 23:18:06 +000017VERSION= `$(TOOLSDIR)/version.sh $(ROOTDIR)`
18
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000019all: manual-pdf
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000020
Nils Wallménius22a5c602008-02-13 16:40:57 +000021features: $(OBJDIR)/features
22
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000023manual-prep: rockbox.tex
24 @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
Martin Arvere425c8e2006-03-16 11:05:22 +000025 @mkdir -p $(OBJDIR)
Dominik Riebelingda6a0782007-01-16 20:24:13 +000026 @find * -type d \! -regex '.*\.svn.*' -exec mkdir -p $(OBJDIR)/{} \;
Dominik Riebelingeed9ab72009-11-29 21:35:03 +000027 @find * -type f \! -regex '.*\.svn.*' -exec cp {} $(OBJDIR)/{} \;
Dominik Riebeling49af12a2007-06-21 15:35:47 +000028 @printf "%s%%" $(VERSION) > $(OBJDIR)/version.tex
Dominik Riebeling32734182008-04-07 17:27:37 +000029 @perl credits.pl < $(DOCSDIR)/CREDITS > $(OBJDIR)/CREDITS.tex
Dominik Riebeling49af12a2007-06-21 15:35:47 +000030 @printf "\\\\newcommand{\\\\platform}{${MANUALDEV}}\n" > $(OBJDIR)/$(MANFILE).tex
31 @printf "\\\\newcommand{\\\\buildversion}{$(VERSION)}\n" >> $(OBJDIR)/$(MANFILE).tex
32 @printf "\\\\input{rockbox.tex}\n" >> $(OBJDIR)/$(MANFILE).tex
Martin Arvere425c8e2006-03-16 11:05:22 +000033 @mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000034
Nils Wallménius22a5c602008-02-13 16:40:57 +000035$(OBJDIR)/features: $(ROOTDIR)/apps/features.txt
36 $(SILENT)mkdir -p `dirname $@`
37 $(SILENT)cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
38 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" -imacros "button.h" - | \
39 grep -v "^\#" | grep -v "^$$" > $@; \
Dominik Riebeling32734182008-04-07 17:27:37 +000040 for f in `cat $(OBJDIR)/features`; do feat="$$feat\\n\\\\edef\\\\UseOption{\\\\UseOption,$$f}" ; done ; \
41 printf "$$feat" >$(OBJDIR)/features.tex
Nils Wallménius22a5c602008-02-13 16:40:57 +000042
43manual-pdf: features manual-prep rockbox.tex
Dominik Riebelingabac7392006-10-23 18:09:38 +000044 $(MAKE) -C $(OBJDIR) buildmanual
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000045
Dominik Riebelinga0584ae2008-11-16 12:42:08 +000046manual-html: features manual-prep rockbox.tex
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000047 $(MAKE) -C $(OBJDIR) buildhtml
48
Dominik Riebelingabac7392006-10-23 18:09:38 +000049manual-txt: manual-html
50 $(MAKE) -C $(OBJDIR) buildtxt
51
52manual-txt-zip: manual-txt
53 $(MAKE) -C $(OBJDIR) txtzip
54
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000055manual-zip: manual-html
56 $(MAKE) -C $(OBJDIR) htmlzip
57
Martin Arvere425c8e2006-03-16 11:05:22 +000058clean:
Jonas Häggqvista8957382006-11-06 10:21:03 +000059 @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
Martin Arvere425c8e2006-03-16 11:05:22 +000060 @rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf
Dominik Riebelingabac7392006-10-23 18:09:38 +000061 @rm -rf $(OBJJDIR)/html $(OBJDIR)/txt