blob: cfccc4d7b2db77facbc7b0cb2251cf6c17ee3d53 [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
Martin Arvere425c8e2006-03-16 11:05:22 +000018.PHONY: all buildmanual clean
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 Riebeling9413c2a2006-07-20 18:07:46 +000023all: manual-pdf
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000024
Nils Wallménius22a5c602008-02-13 16:40:57 +000025features: $(OBJDIR)/features
26
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000027manual-prep: rockbox.tex
28 @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
Martin Arvere425c8e2006-03-16 11:05:22 +000029 @mkdir -p $(OBJDIR)
Dominik Riebelingda6a0782007-01-16 20:24:13 +000030 @find * -type d \! -regex '.*\.svn.*' -exec mkdir -p $(OBJDIR)/{} \;
Dominik Riebelingeed9ab72009-11-29 21:35:03 +000031 @find * -type f \! -regex '.*\.svn.*' -exec cp {} $(OBJDIR)/{} \;
Dominik Riebeling49af12a2007-06-21 15:35:47 +000032 @printf "%s%%" $(VERSION) > $(OBJDIR)/version.tex
Dominik Riebeling32734182008-04-07 17:27:37 +000033 @perl credits.pl < $(DOCSDIR)/CREDITS > $(OBJDIR)/CREDITS.tex
Dominik Riebeling49af12a2007-06-21 15:35:47 +000034 @printf "\\\\newcommand{\\\\platform}{${MANUALDEV}}\n" > $(OBJDIR)/$(MANFILE).tex
35 @printf "\\\\newcommand{\\\\buildversion}{$(VERSION)}\n" >> $(OBJDIR)/$(MANFILE).tex
36 @printf "\\\\input{rockbox.tex}\n" >> $(OBJDIR)/$(MANFILE).tex
Martin Arvere425c8e2006-03-16 11:05:22 +000037 @mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000038
Nils Wallménius22a5c602008-02-13 16:40:57 +000039$(OBJDIR)/features: $(ROOTDIR)/apps/features.txt
Dominik Riebeling780968d2011-09-13 20:30:37 +000040 @echo "processing $(notdir $^)"
Nils Wallménius22a5c602008-02-13 16:40:57 +000041 $(SILENT)mkdir -p `dirname $@`
42 $(SILENT)cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
43 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" -imacros "button.h" - | \
44 grep -v "^\#" | grep -v "^$$" > $@; \
Dominik Riebeling32734182008-04-07 17:27:37 +000045 for f in `cat $(OBJDIR)/features`; do feat="$$feat\\n\\\\edef\\\\UseOption{\\\\UseOption,$$f}" ; done ; \
46 printf "$$feat" >$(OBJDIR)/features.tex
Nils Wallménius22a5c602008-02-13 16:40:57 +000047
48manual-pdf: features manual-prep rockbox.tex
Dominik Riebelingabac7392006-10-23 18:09:38 +000049 $(MAKE) -C $(OBJDIR) buildmanual
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000050
Dominik Riebelinga0584ae2008-11-16 12:42:08 +000051manual-html: features manual-prep rockbox.tex
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000052 $(MAKE) -C $(OBJDIR) buildhtml
53
Dominik Riebelingabac7392006-10-23 18:09:38 +000054manual-txt: manual-html
55 $(MAKE) -C $(OBJDIR) buildtxt
56
57manual-txt-zip: manual-txt
58 $(MAKE) -C $(OBJDIR) txtzip
59
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000060manual-zip: manual-html
61 $(MAKE) -C $(OBJDIR) htmlzip
62
Martin Arvere425c8e2006-03-16 11:05:22 +000063clean:
Jonas Häggqvista8957382006-11-06 10:21:03 +000064 @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
Martin Arvere425c8e2006-03-16 11:05:22 +000065 @rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf
Rafaël Carré2a2d2282011-08-13 20:03:30 +000066 @rm -rf $(OBJDIR)/html $(OBJDIR)/txt