source: rtems/Makefile.maint @ b767f966

4.104.114.84.95
Last change on this file since b767f966 was f9f1d96, checked in by Joel Sherrill <joel.sherrill@…>, on 02/21/07 at 22:57:20

2007-02-21 Joel Sherrill <joel@…>

  • Makefile.maint: Added TOOL_VERSIONS stanza and fixed typo.
  • Property mode set to 100644
File size: 4.5 KB
Line 
1#
2# Maintainer Makefile
3#
4
5# WARNING:
6
7# THIS IS EXPERIMENTAL - DO NOT USE (YET) !
8
9# * This Makefile is only useful to RTEMS maintainers
10# * You must have write access to RTEMS CVS
11# * Running this Makefile modifies RTEMS CVS
12# * Watch out for warning and error messages - Do NOT IGNORE them!
13
14
15# MAINTAINER notes:
16
17# Cutting a new release:
18# 1. Perform a non-anonymous cvs checkout of the BRANCH
19#    you want to cut a release tarball from
20# 2. Run "make -f Makefile.maint new-revision"
21#    (rsp. "make -f Makefile.maint new-minor").
22# 3. Run "make -f Makefile.maint commit"
23# 4. Run "make -f Makefile.maint tag"
24# 5. Run "make -f Makefile.maint tarball"
25
26# -----------------
27# SECURITY: Append a string to tag to avoid accidentially screwing up cvs-tags
28# For "hot runs" you will want to use "make -f Makefile.maint TEST_TAG= <command>"
29TEST_TAG = -test1
30
31rtems_version := $(shell cat VERSION | sed -n '/.* Version /{s/^.*Version[ ]*\([0-9\.]\+\)/\1/p};')
32rtems_tag     := $(shell echo "rtems-$(rtems_version)" | tr . -)
33
34# -----------------
35# Cleanup check out and cvs-tag the files inside
36tag:
37        cvs -z9 up -dP >/dev/null
38        PATH=/opt/rtems-4.8/bin:$$PATH ./bootstrap -p >/dev/null
39        cvs tag -c $(rtems_tag)$(TEST_TAG) >/dev/null
40
41# -----------------
42# Different stages of cvs-exporting
43rtems-$(rtems_version)/stamp.export:
44        rm -rf rtems-$(rtems_version)
45        @cvs -z9 export -d rtems-$(rtems_version) -r $(rtems_tag)$(TEST_TAG) rtems >/dev/null
46        @if ! test -f rtems-$(rtems_version)/VERSION; then \
47        echo "ERROR export failed"; \
48        echo " Did you run 'make -f Makefile.maint tag' ?"; exit1; fi
49        touch rtems-$(rtems_version)/stamp.export
50
51rtems-$(rtems_version).tar.bz2: rtems-$(rtems_version)/stamp.autofiles rtems-$(rtems_version)/excludes
52        tar -cj -X rtems-$(rtems_version)/excludes \
53          -f rtems-$(rtems_version).tar.bz2 rtems-$(rtems_version)
54
55rtems-$(rtems_version)/stamp.cleanup: rtems-$(rtems_version)/stamp.export
56        find rtems-$(rtems_version) -name .cvsignore -exec rm -f {} \;
57        find rtems-$(rtems_version) -name preinstall.am -exec touch {} \;
58        touch rtems-$(rtems_version)/c/src/librdbg/src/*/*/remdeb*.[hc]
59        rm -rf rtems-$(rtems_version)/contrib
60        touch rtems-$(rtems_version)/stamp.cleanup
61
62rtems-$(rtems_version)/stamp.autofiles: rtems-$(rtems_version)/stamp.cleanup
63        cd rtems-$(rtems_version) && PATH=/opt/rtems-4.8/bin:$$PATH ./bootstrap -r
64        touch rtems-$(rtems_version)/stamp.autofiles
65
66rtems-$(rtems_version)/excludes: Makefile.maint
67        @echo "Generating $@"
68        @echo "excludes" > $@
69        @echo "stamp.*" >> $@
70        @echo "autom4te.cache" >> $@
71        @echo "Makefile.maint" >> $@
72
73tarball: rtems-$(rtems_version).tar.bz2
74
75TOOL_VERSIONS: Makefile.maint
76        ( \
77         date ; \
78         echo ; \
79         echo "This file contains configuration information on the " ; \
80         echo "primary computer used to test and make the $(rtems_version)" ; \
81         echo "version of RTEMS" ; \
82         echo ; \
83         echo "OS Version: " `head -1 /etc/issue` ; \
84         echo ; \
85         echo "The following RTEMS RPMs were installed on the machine" ; \
86         echo "where this release was made:" ; \
87         echo ; \
88         rpm -q -a | grep rtems-4.8 | sed -e 's/^/    /' ; \
89         echo \
90         ) >TOOL_VERSIONS
91
92# -----------------
93# Create a new minor release
94# increments the 2nd digit of the version number
95# set the 3rd digit of the version number to 0
96# Example: 4.6.99.4 -> 4.7.0
97new-minor:
98        @v=$$(echo $(rtems_version) | sed 's,^\([0-9]\+\).*,\1,'); \
99        r=$$(echo $(rtems_version) | sed 's,^[0-9]\+\.\([0-9]\+\).*,\1,'); \
100        r=$$(($$r + 1)); version="$$v.$$r.0"; \
101        echo "New minor release: $$version"; \
102        sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
103          $(VERSION_FILES); \
104        sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
105
106# Create a new revision release
107# increments the last digit of the version number
108# Examples: 4.6.99.4 -> 4.6.99.5
109#           4.7.0 -> 4.7.1
110new-revision:
111        @m=$$(echo $(rtems_version) | sed 's,^\(.*\)\.[0-9]\+,\1,'); \
112        n=$$(echo $(rtems_version) | sed 's,^.*\.\([0-9]\+\),\1,'); \
113        n=$$(($$n + 1)); version="$$m.$$n";\
114        echo "New revision release: $$version"; \
115        sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
116          $(VERSION_FILES); \
117        sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
118
119VERSION_FILES += aclocal/version.m4
120VERSION_FILES += cpukit/aclocal/version.m4
121VERSION_FILES += c/src/aclocal/version.m4
122VERSION_FILES += testsuites/aclocal/version.m4
123
124CVS_RUN := $(shell if [ -n "$(TEST_TAG)" ]; then echo "cvs -n"; else echo "cvs"; fi)
125
126commit:
127        $(CVS_RUN) commit -m "Upgrade to $(rtems_version)" \
128          $(VERSION_FILES) VERSION
129
130.PHONY: commit new-minor new-revision tag tarball
Note: See TracBrowser for help on using the repository browser.