blob: 410d5a68f5722ad1a66c74b0fdc9df8b0bd95ec3 [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
Dominik Riebeling780968d2011-09-13 20:30:37 +000010ifndef V
11SILENT=@
12endif
13
Nils Wallménius22a5c602008-02-13 16:40:57 +000014# Needed to build the features list.
15INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
16 -I$(BUILDDIR)/bitmaps -I$(OBJDIR)
Dominik Riebeling49af12a2007-06-21 15:35:47 +000017
Dominik Riebeling3a660052011-11-05 10:53:10 +000018.PHONY: all buildmanual clean objdir-check
Dominik Riebeling49af12a2007-06-21 15:35:47 +000019MANFILE := rockbox-build
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000020
Rafaël Carrécdc42452010-05-30 23:18:06 +000021VERSION= `$(TOOLSDIR)/version.sh $(ROOTDIR)`
22
Dominik Riebeling3a660052011-11-05 10:53:10 +000023.PHONY: $(OBJDIR)/version.tex $(OBJDIR)/$(MANFILE).tex
24
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000025all: manual-pdf
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000026
Dominik Riebeling3a660052011-11-05 10:53:10 +000027features: $(OBJDIR)/features.tex
Nils Wallménius22a5c602008-02-13 16:40:57 +000028
Dominik Riebeling3a660052011-11-05 10:53:10 +000029objdir-check:
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000030 @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000031
Dominik Riebeling3a660052011-11-05 10:53:10 +000032
33manual-prep: objdir-check rockbox.tex $(OBJDIR)/CREDITS.tex $(OBJDIR)/version.tex $(OBJDIR)/$(MANFILE).tex
34 $(SILENT)mkdir -p $(OBJDIR)
35 $(SILENT)find * -type d \! -regex '.*\.svn.*' -exec mkdir -p $(OBJDIR)/{} \;
Marianne Arnold6c0a1cb2012-05-20 17:17:49 +020036 $(SILENT)find -L * -type f \! -regex '.*\.svn.*' -exec cp {} $(OBJDIR)/{} \;
Dominik Riebeling3a660052011-11-05 10:53:10 +000037 $(SILENT)mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
38
39$(OBJDIR)/$(MANFILE).tex:
40 @echo "creating $(notdir $@)"
Dominik Riebelinga3cc4282011-11-10 19:40:36 +000041 $(SILENT)printf "\\\\newcommand{\\\\platform}{${MANUALDEV}}\n" > $@
42 $(SILENT)printf "\\\\newcommand{\\\\buildversion}{$(VERSION)}\n" >> $@
43 $(SILENT)printf "\\\\input{rockbox.tex}\n" >> $@
Dominik Riebeling3a660052011-11-05 10:53:10 +000044
45$(OBJDIR)/CREDITS.tex: $(DOCSDIR)/CREDITS
46 @echo "processing $(notdir $^)"
Dominik Riebelingb4a09682012-07-03 22:53:01 +020047 $(SILENT)mkdir -p $(OBJDIR)
Dominik Riebelinga3cc4282011-11-10 19:40:36 +000048 $(SILENT)perl credits.pl < $(DOCSDIR)/CREDITS > $@
Dominik Riebeling3a660052011-11-05 10:53:10 +000049
50$(OBJDIR)/version.tex:
51 @echo "creating $(notdir $@)"
Dominik Riebelingb4a09682012-07-03 22:53:01 +020052 $(SILENT)mkdir -p $(OBJDIR)
Dominik Riebelinga3cc4282011-11-10 19:40:36 +000053 $(SILENT)printf "%s%%" $(VERSION) > $@
Dominik Riebeling3a660052011-11-05 10:53:10 +000054
55$(OBJDIR)/features.tex: $(ROOTDIR)/apps/features.txt
Dominik Riebeling780968d2011-09-13 20:30:37 +000056 @echo "processing $(notdir $^)"
Dominik Riebelingb4a09682012-07-03 22:53:01 +020057 $(SILENT)mkdir -p $(OBJDIR)
Nils Wallménius22a5c602008-02-13 16:40:57 +000058 $(SILENT)mkdir -p `dirname $@`
Dominik Riebelinga3cc4282011-11-10 19:40:36 +000059 $(SILENT) for f in \
60 $$(cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
61 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" \
62 -imacros "button.h" - | grep -v "^\#" | grep -v "^$$"); \
63 do feat="$$feat\\n\\\\edef\\\\UseOption{\\\\UseOption,$$f}"; done ; \
64 printf "$$feat" > $@
Nils Wallménius22a5c602008-02-13 16:40:57 +000065
Dominik Riebeling3a660052011-11-05 10:53:10 +000066manual-pdf: objdir-check features manual-prep rockbox.tex
67 $(SILENT)$(MAKE) -C $(OBJDIR) buildmanual
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000068
Dominik Riebeling3a660052011-11-05 10:53:10 +000069manual-html: objdir-check features manual-prep rockbox.tex
70 $(SILENT)$(MAKE) -C $(OBJDIR) buildhtml
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000071
Dominik Riebelingabac7392006-10-23 18:09:38 +000072manual-txt: manual-html
Dominik Riebeling3a660052011-11-05 10:53:10 +000073 $(SILENT)$(MAKE) -C $(OBJDIR) buildtxt
Dominik Riebelingabac7392006-10-23 18:09:38 +000074
75manual-txt-zip: manual-txt
Dominik Riebeling3a660052011-11-05 10:53:10 +000076 $(SILENT)$(MAKE) -C $(OBJDIR) txtzip
Dominik Riebelingabac7392006-10-23 18:09:38 +000077
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000078manual-zip: manual-html
Dominik Riebeling3a660052011-11-05 10:53:10 +000079 $(SILENT)$(MAKE) -C $(OBJDIR) htmlzip
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000080
Dominik Riebeling3a660052011-11-05 10:53:10 +000081clean: objdir-check
82 $(SILENT)rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf
83 $(SILENT)rm -rf $(OBJDIR)/html $(OBJDIR)/txt