blob: 6a52af1024dccb4e878873393372dde44f0aac5a [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
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000017all: manual-pdf
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000018
Nils Wallménius22a5c602008-02-13 16:40:57 +000019features: $(OBJDIR)/features
20
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000021manual-prep: rockbox.tex
22 @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
Martin Arvere425c8e2006-03-16 11:05:22 +000023 @mkdir -p $(OBJDIR)
Dominik Riebelingda6a0782007-01-16 20:24:13 +000024 @find * -type d \! -regex '.*\.svn.*' -exec mkdir -p $(OBJDIR)/{} \;
Dominik Riebeling49af12a2007-06-21 15:35:47 +000025 @find * -type f \! -regex '.*\.svn.*' -exec cp -u {} $(OBJDIR)/{} \;
26 @printf "%s%%" $(VERSION) > $(OBJDIR)/version.tex
Dominik Riebeling32734182008-04-07 17:27:37 +000027 @perl credits.pl < $(DOCSDIR)/CREDITS > $(OBJDIR)/CREDITS.tex
Dominik Riebeling49af12a2007-06-21 15:35:47 +000028 @printf "\\\\newcommand{\\\\platform}{${MANUALDEV}}\n" > $(OBJDIR)/$(MANFILE).tex
29 @printf "\\\\newcommand{\\\\buildversion}{$(VERSION)}\n" >> $(OBJDIR)/$(MANFILE).tex
30 @printf "\\\\input{rockbox.tex}\n" >> $(OBJDIR)/$(MANFILE).tex
Martin Arvere425c8e2006-03-16 11:05:22 +000031 @mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000032
Nils Wallménius22a5c602008-02-13 16:40:57 +000033$(OBJDIR)/features: $(ROOTDIR)/apps/features.txt
34 $(SILENT)mkdir -p `dirname $@`
35 $(SILENT)cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
36 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" -imacros "button.h" - | \
37 grep -v "^\#" | grep -v "^$$" > $@; \
Dominik Riebeling32734182008-04-07 17:27:37 +000038 for f in `cat $(OBJDIR)/features`; do feat="$$feat\\n\\\\edef\\\\UseOption{\\\\UseOption,$$f}" ; done ; \
39 printf "$$feat" >$(OBJDIR)/features.tex
Nils Wallménius22a5c602008-02-13 16:40:57 +000040
41manual-pdf: features manual-prep rockbox.tex
Dominik Riebelingabac7392006-10-23 18:09:38 +000042 $(MAKE) -C $(OBJDIR) buildmanual
Christi Scarboroughd68d7c02006-02-06 07:25:25 +000043
Dominik Riebelinga0584ae2008-11-16 12:42:08 +000044manual-html: features manual-prep rockbox.tex
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000045 $(MAKE) -C $(OBJDIR) buildhtml
46
Dominik Riebelingabac7392006-10-23 18:09:38 +000047manual-txt: manual-html
48 $(MAKE) -C $(OBJDIR) buildtxt
49
50manual-txt-zip: manual-txt
51 $(MAKE) -C $(OBJDIR) txtzip
52
Dominik Riebeling9413c2a2006-07-20 18:07:46 +000053manual-zip: manual-html
54 $(MAKE) -C $(OBJDIR) htmlzip
55
Martin Arvere425c8e2006-03-16 11:05:22 +000056clean:
Jonas Häggqvista8957382006-11-06 10:21:03 +000057 @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi
Martin Arvere425c8e2006-03-16 11:05:22 +000058 @rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf
Dominik Riebelingabac7392006-10-23 18:09:38 +000059 @rm -rf $(OBJJDIR)/html $(OBJDIR)/txt