Merge commit 'hpa/master' into for-erwan
[profile/ivi/syslinux.git] / Makefile.private
1 ## -*- makefile -*- ------------------------------------------------------
2 ##
3 ##   Copyright 2000-2008 H. Peter Anvin - All Rights Reserved
4 ##
5 ##   This program is free software; you can redistribute it and/or modify
6 ##   it under the terms of the GNU General Public License as published by
7 ##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ##   Boston MA 02111-1307, USA; either version 2 of the License, or
9 ##   (at your option) any later version; incorporated herein by reference.
10 ##
11 ## -----------------------------------------------------------------------
12
13 #
14 # This should only be used by the maintainer to generate official binaries
15 # for release.  Please do not "make official" and distribute the binaries,
16 # please.
17 #
18 .PHONY: official release
19
20 PRIVATE = Makefile.private
21
22 GIT_DIR ?= .git
23 ABS_GIT_DIR := $(shell cd '$(GIT_DIR)' 2>/dev/null && pwd)
24
25 -include release/Makefile.secret
26
27 isolinux.iso: all
28         cp isolinux-debug.bin isolinux-test/isolinux/isolinux.bin
29         mkisofs -v -r -J \
30                 -b isolinux/isolinux.bin -c isolinux/boot.cat \
31                 -no-emul-boot -boot-load-size 4 -boot-info-table \
32                 -o isolinux.iso isolinux-test
33
34 burn: isolinux.iso
35         cdrecord -v blank=fast isolinux.iso
36
37 official:
38         $(MAKE) spotless CC='$(CC) -m32'
39         $(MAKE) all CC='$(CC) -m32'
40         $(MAKE) dist CC='$(CC) -m32'
41
42 release:
43         test -d release
44         git tag -a -m syslinux-$(VERSION) -f syslinux-$(VERSION)
45         -rm -rf release/syslinux-$(VERSION)
46         -rm -f release/syslinux-$(VERSION).*
47         mkdir -p release/syslinux-$(VERSION)
48         git archive --format=tar syslinux-$(VERSION) | \
49                 tar -x -f - -C release/syslinux-$(VERSION)
50         find release/syslinux-$(VERSION) \
51                 \( -name '*~' -or -name '#*' \) -type f -print0 | \
52                 xargs -0rt rm -f
53         sed -e 's/@@VERSION@@/$(VERSION)/g' -e 's/@@RPMVERSION@@/$(VERSION)/g' \
54                 < release/syslinux-$(VERSION)/syslinux.spec.in \
55                 > release/syslinux-$(VERSION)/syslinux.spec
56         rm -f release/syslinux-$(VERSION)/syslinux.spec.in
57         $(MAKE) -C release/syslinux-$(VERSION) official DATE=`date +%Y-%m-%d`
58
59         cd release/syslinux-$(VERSION) && rm -rf $(PRIVATE)
60         cd release && tar cvvf - syslinux-$(VERSION) | \
61                 gzip -9 > syslinux-$(VERSION).tar.gz
62         cd release/syslinux-$(VERSION) && \
63                 zip -9r ../syslinux-$(VERSION).zip *
64
65
66 PRERELDIR := release/syslinux-$(VERSION)-pre
67 PRERELNO  := $(shell cat $(PRERELDIR)/.prerel 2>/dev/null || echo 1)
68 PREREL    := syslinux-$(VERSION)-pre$(PRERELNO)
69 RPMPREREL := $(shell $(PERL) -e 'printf "%.2f.%d\n", $(VERSION)-0.01, $(PRERELNO);')
70
71 prerel:
72         test -d release
73         git tag -a -m $(PREREL) -f $(PREREL)
74         -rm -rf $(PRERELDIR)/$(PREREL)
75         -rm -f $(PRERELDIR)/$(PREREL).*
76         mkdir -p $(PRERELDIR)/$(PREREL)
77         git archive --format=tar $(PREREL) | \
78                 tar -x -f - -C $(PRERELDIR)/$(PREREL)
79         find $(PRERELDIR)/$(PREREL) \
80                 \( -name '*~' -or -name '#*' \) -type f -print0 | \
81                 xargs -0rt rm -f
82         sed -e 's/@@VERSION@@/$(VERSION)-pre$(PRERELNO)/g' \
83             -e 's/@@RPMVERSION@@/$(RPMPREREL)/g' \
84                 < $(PRERELDIR)/$(PREREL)/syslinux.spec.in \
85                 > $(PRERELDIR)/$(PREREL)/syslinux.spec
86         rm -f $(PRERELDIR)/$(PREREL)/syslinux.spec.in
87         $(MAKE) -C $(PRERELDIR)/$(PREREL) official DATE=`printf '%s-pre%d          ' $(VERSION) $(PRERELNO) | dd bs=10 count=1 2>/dev/null`
88         cd $(PRERELDIR)/$(PREREL) && rm -rf $(PRIVATE)
89         cd $(PRERELDIR) && tar cvvf - $(PREREL) | \
90                 gzip -9 > $(PREREL).tar.gz
91         cd $(PRERELDIR)/$(PREREL) && \
92                 zip -9r ../$(PREREL).zip *
93         expr $(PRERELNO) + 1 > $(PRERELDIR)/.prerel
94
95 LATEST_PRERELNO := $(shell expr $(PRERELNO) - 1)
96 LATEST_PREREL   := syslinux-$(VERSION)-pre$(LATEST_PRERELNO)
97
98 unprerel:
99         echo $(LATEST_PRERELNO) > $(PRERELDIR)/.prerel
100         @echo Next release will be $(LATEST_PREREL)
101
102 preupload:
103         scp $(PRERELDIR)/$(LATEST_PREREL).* $(UPLOAD)/Testing
104         git push --tags