Dominik Riebeling | cb9fdf7 | 2007-01-14 23:29:15 +0000 | [diff] [blame] | 1 | # __________ __ ___. |
| 2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 6 | # \/ \/ \/ \/ \/ |
Dominik Riebeling | 6de815b | 2007-01-15 17:45:04 +0000 | [diff] [blame] | 7 | # $Id$ |
Dominik Riebeling | cb9fdf7 | 2007-01-14 23:29:15 +0000 | [diff] [blame] | 8 | # |
| 9 | |
Dominik Riebeling | 780968d | 2011-09-13 20:30:37 +0000 | [diff] [blame] | 10 | ifndef V |
| 11 | SILENT=@ |
| 12 | endif |
| 13 | |
Nils Wallménius | 22a5c60 | 2008-02-13 16:40:57 +0000 | [diff] [blame] | 14 | # Needed to build the features list. |
| 15 | INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ |
| 16 | -I$(BUILDDIR)/bitmaps -I$(OBJDIR) |
Dominik Riebeling | 49af12a | 2007-06-21 15:35:47 +0000 | [diff] [blame] | 17 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 18 | .PHONY: all buildmanual clean objdir-check |
Dominik Riebeling | 49af12a | 2007-06-21 15:35:47 +0000 | [diff] [blame] | 19 | MANFILE := rockbox-build |
Christi Scarborough | d68d7c0 | 2006-02-06 07:25:25 +0000 | [diff] [blame] | 20 | |
Rafaël Carré | cdc4245 | 2010-05-30 23:18:06 +0000 | [diff] [blame] | 21 | VERSION= `$(TOOLSDIR)/version.sh $(ROOTDIR)` |
| 22 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 23 | .PHONY: $(OBJDIR)/version.tex $(OBJDIR)/$(MANFILE).tex |
| 24 | |
Dominik Riebeling | 9413c2a | 2006-07-20 18:07:46 +0000 | [diff] [blame] | 25 | all: manual-pdf |
Christi Scarborough | d68d7c0 | 2006-02-06 07:25:25 +0000 | [diff] [blame] | 26 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 27 | features: $(OBJDIR)/features.tex |
Nils Wallménius | 22a5c60 | 2008-02-13 16:40:57 +0000 | [diff] [blame] | 28 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 29 | objdir-check: |
Dominik Riebeling | 9413c2a | 2006-07-20 18:07:46 +0000 | [diff] [blame] | 30 | @if [ "$(OBJDIR)" = "" ]; then echo Run make in you build directory!; false; fi |
Dominik Riebeling | 9413c2a | 2006-07-20 18:07:46 +0000 | [diff] [blame] | 31 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 32 | |
| 33 | manual-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 Arnold | 6c0a1cb | 2012-05-20 17:17:49 +0200 | [diff] [blame] | 36 | $(SILENT)find -L * -type f \! -regex '.*\.svn.*' -exec cp {} $(OBJDIR)/{} \; |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 37 | $(SILENT)mv $(OBJDIR)/Makefile.pdflatex $(OBJDIR)/Makefile |
| 38 | |
| 39 | $(OBJDIR)/$(MANFILE).tex: |
| 40 | @echo "creating $(notdir $@)" |
Dominik Riebeling | a3cc428 | 2011-11-10 19:40:36 +0000 | [diff] [blame] | 41 | $(SILENT)printf "\\\\newcommand{\\\\platform}{${MANUALDEV}}\n" > $@ |
| 42 | $(SILENT)printf "\\\\newcommand{\\\\buildversion}{$(VERSION)}\n" >> $@ |
| 43 | $(SILENT)printf "\\\\input{rockbox.tex}\n" >> $@ |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 44 | |
| 45 | $(OBJDIR)/CREDITS.tex: $(DOCSDIR)/CREDITS |
| 46 | @echo "processing $(notdir $^)" |
Dominik Riebeling | b4a0968 | 2012-07-03 22:53:01 +0200 | [diff] [blame] | 47 | $(SILENT)mkdir -p $(OBJDIR) |
Dominik Riebeling | a3cc428 | 2011-11-10 19:40:36 +0000 | [diff] [blame] | 48 | $(SILENT)perl credits.pl < $(DOCSDIR)/CREDITS > $@ |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 49 | |
| 50 | $(OBJDIR)/version.tex: |
| 51 | @echo "creating $(notdir $@)" |
Dominik Riebeling | b4a0968 | 2012-07-03 22:53:01 +0200 | [diff] [blame] | 52 | $(SILENT)mkdir -p $(OBJDIR) |
Dominik Riebeling | a3cc428 | 2011-11-10 19:40:36 +0000 | [diff] [blame] | 53 | $(SILENT)printf "%s%%" $(VERSION) > $@ |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 54 | |
| 55 | $(OBJDIR)/features.tex: $(ROOTDIR)/apps/features.txt |
Dominik Riebeling | 780968d | 2011-09-13 20:30:37 +0000 | [diff] [blame] | 56 | @echo "processing $(notdir $^)" |
Dominik Riebeling | b4a0968 | 2012-07-03 22:53:01 +0200 | [diff] [blame] | 57 | $(SILENT)mkdir -p $(OBJDIR) |
Nils Wallménius | 22a5c60 | 2008-02-13 16:40:57 +0000 | [diff] [blame] | 58 | $(SILENT)mkdir -p `dirname $@` |
Dominik Riebeling | a3cc428 | 2011-11-10 19:40:36 +0000 | [diff] [blame] | 59 | $(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énius | 22a5c60 | 2008-02-13 16:40:57 +0000 | [diff] [blame] | 65 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 66 | manual-pdf: objdir-check features manual-prep rockbox.tex |
| 67 | $(SILENT)$(MAKE) -C $(OBJDIR) buildmanual |
Christi Scarborough | d68d7c0 | 2006-02-06 07:25:25 +0000 | [diff] [blame] | 68 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 69 | manual-html: objdir-check features manual-prep rockbox.tex |
| 70 | $(SILENT)$(MAKE) -C $(OBJDIR) buildhtml |
Dominik Riebeling | 9413c2a | 2006-07-20 18:07:46 +0000 | [diff] [blame] | 71 | |
Dominik Riebeling | abac739 | 2006-10-23 18:09:38 +0000 | [diff] [blame] | 72 | manual-txt: manual-html |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 73 | $(SILENT)$(MAKE) -C $(OBJDIR) buildtxt |
Dominik Riebeling | abac739 | 2006-10-23 18:09:38 +0000 | [diff] [blame] | 74 | |
| 75 | manual-txt-zip: manual-txt |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 76 | $(SILENT)$(MAKE) -C $(OBJDIR) txtzip |
Dominik Riebeling | abac739 | 2006-10-23 18:09:38 +0000 | [diff] [blame] | 77 | |
Dominik Riebeling | 9413c2a | 2006-07-20 18:07:46 +0000 | [diff] [blame] | 78 | manual-zip: manual-html |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 79 | $(SILENT)$(MAKE) -C $(OBJDIR) htmlzip |
Dominik Riebeling | 9413c2a | 2006-07-20 18:07:46 +0000 | [diff] [blame] | 80 | |
Dominik Riebeling | 3a66005 | 2011-11-05 10:53:10 +0000 | [diff] [blame] | 81 | clean: objdir-check |
| 82 | $(SILENT)rm -rf $(OBJDIR)/manual $(OBJDIR)/*.pdf |
| 83 | $(SILENT)rm -rf $(OBJDIR)/html $(OBJDIR)/txt |