source: rtems/Makefile.maint @ b42cae7

4.11
Last change on this file since b42cae7 was b42cae7, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 4, 2011 at 4:22:17 PM

2011-03-04 Ralf Corsépius <ralf.corsepius@…>

  • Makefile.maint, aclocal/rpm.m4, aclocal/rtems-top.m4, aclocal/version.m4: Rename RTEMS_API into _RTEMS_API.
  • Property mode set to 100644
File size: 5.9 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
18# Cutting a new release:
19# 1. Perform a non-anonymous cvs checkout of the BRANCH
20#    you want to cut a release tarball from
21# 2. Run "make -f Makefile.maint new-revision"
22#    (rsp. "make -f Makefile.maint new-minor").
23# 3. Run "make -f Makefile.maint commit"
24# 4. Run "make -f Makefile.maint tag"
25# 5. Run "make -f Makefile.maint tarball"
26
27# -----------------
28# SECURITY: Append a string to tag to avoid accidentially screwing up cvs-tags
29# For "hot runs" you will want to use "make -f Makefile.maint TAG_SUFFIX= <command>"
30TAG_SUFFIX = -test1
31
32rtems_version := $(shell cat VERSION | sed -n '/.* Version /{s/^.*Version[ ]*\([0-9\.]\+\)/\1/p};')
33rtems_tag     := $(shell echo "rtems-$(rtems_version)" | tr . -)
34rtems_api     := 4.10
35PATH          := /opt/rtems-$(rtems_api)/bin:$(PATH)
36
37# -----------------
38# Cleanup check out and cvs-tag the files inside
39tag:
40        cvs -q -z9 up -dP
41        ./bootstrap -p >/dev/null
42        cvs -q tag -c $(rtems_tag)$(TAG_SUFFIX)
43
44# -----------------
45# Different stages of cvs-exporting
46rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX):
47        rm -rf rtems-$(rtems_version)
48        @cvs -q -z9 export -d rtems-$(rtems_version) -r $(rtems_tag)$(TAG_SUFFIX) rtems
49        @if ! test -f rtems-$(rtems_version)/VERSION; then \
50        echo "ERROR export failed"; \
51        echo " Did you run 'make -f Makefile.maint tag' ?"; exit 1; fi
52        echo "$(rtems_tag)$(TAG_SUFFIX)" > rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX)
53
54rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2: rtems-$(rtems_version)/stamp.autofiles \
55          rtems-$(rtems_version)/excludes \
56          rtems-$(rtems_version)/TOOL_VERSIONS
57        cd rtems-$(rtems_version) ; \
58          touch doc/ada_user/ada_user.texi doc/bsp_howto/bsp_howto.texi \
59            doc/cpu_supplement/cpu_supplement.texi \
60            doc/develenv/develenv.texi doc/filesystem/filesystem.texi \
61            doc/networking/networking.texi \
62            doc/new_chapters/new_chapters.texi \
63            doc/porting/porting.texi doc/posix1003.1/posix1003_1.texi \
64            doc/posix_users/posix_users.texi doc/relnotes/relnotes.texi \
65            doc/started_ada/started_ada.texi doc/started/started.texi \
66            doc/user/c_user.texi
67        tar -cj -X rtems-$(rtems_version)/excludes \
68          -f rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2 rtems-$(rtems_version)
69
70## Touching the top pages in the various manuals results in the date
71## on their title page matching the release date.
72rtems-$(rtems_version)/stamp.cleanup: rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX)
73        find rtems-$(rtems_version) -name .cvsignore -exec rm -f {} \;
74        find rtems-$(rtems_version) -name preinstall.am -exec touch {} \;
75        rm -rf rtems-$(rtems_version)/contrib
76        touch rtems-$(rtems_version)/stamp.cleanup
77
78rtems-$(rtems_version)/stamp.autofiles: rtems-$(rtems_version)/stamp.cleanup
79        cd rtems-$(rtems_version) && ./bootstrap -r
80        touch rtems-$(rtems_version)/stamp.autofiles
81
82rtems-$(rtems_version)/excludes: Makefile.maint
83        @echo "Generating $@"
84        @echo "excludes" > $@
85        @echo "stamp.*" >> $@
86        @echo "autom4te.cache" >> $@
87        @echo "Makefile.maint" >> $@
88
89tarball: rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2
90
91rtems-$(rtems_version)/TOOL_VERSIONS: Makefile.maint
92        ( \
93         date ; \
94         echo ; \
95         echo "This file contains configuration information on the " ; \
96         echo "primary computer used to test and make the $(rtems_version)" ; \
97         echo "version of RTEMS" ; \
98         echo ; \
99         echo "OS Version: " `head -1 /etc/issue` ; \
100         echo ; \
101         echo "The following RTEMS RPMs were installed on the machine" ; \
102         echo "where this release was made:" ; \
103         echo ; \
104         rpm -qa 'rtems-$(rtems_api)-*' | sort | sed -e 's/^/    /' ; \
105         echo \
106         ) > $@
107
108# -----------------
109# Create a new minor release
110# increments the 2nd digit of the version number
111# set the 3rd digit of the version number to 0
112# Example: 4.6.99.4 -> 4.7.0
113new-minor:
114        @v=$$(echo $(rtems_version) | sed 's,^\([0-9]\+\).*,\1,'); \
115        r=$$(echo $(rtems_version) | sed 's,^[0-9]\+\.\([0-9]\+\).*,\1,'); \
116        r=$$(($$r + 1)); version="$$v.$$r.0"; \
117        echo "New minor release: $$version"; \
118        sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
119          $(VERSION_FILES); \
120        sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
121
122# Create a new revision release
123# increments the last digit of the version number
124# Examples: 4.6.99.4 -> 4.6.99.5
125#           4.7.0 -> 4.7.1
126new-revision:
127        @m=$$(echo $(rtems_version) | sed 's,^\(.*\)\.[0-9]\+,\1,'); \
128        n=$$(echo $(rtems_version) | sed 's,^.*\.\([0-9]\+\),\1,'); \
129        n=$$(($$n + 1)); version="$$m.$$n";\
130        echo "New revision release: $$version"; \
131        sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
132          $(VERSION_FILES); \
133        sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
134
135# -----------------
136# Create a new branch
137# increments the 2nd digit of the version number
138# set the 3rd digit of the version number to 99
139# set the 4rd digit of the version number to 0
140# Example: 4.6.34.4 -> 4.7.99.0
141new-branch:
142        v=$$(echo $(rtems_version) | sed 's,^\([0-9]\+\).*,\1,'); \
143        r=$$(echo $(rtems_version) | sed 's,^[0-9]\+\.\([0-9]\+\).*,\1,'); \
144        r=$$(($$r + 1)); version="$$v.$$r.99.0"; \
145        api="$$v.$$(($$r + 1))"; \
146        echo "New branch release: $$version"; \
147        sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
148          -e "s|\[_RTEMS_API\],\[.*\]|\[_RTEMS_API\],\[$$api\]|" \
149          $(VERSION_FILES); \
150        sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
151
152VERSION_FILES += aclocal/version.m4
153VERSION_FILES += cpukit/aclocal/version.m4
154VERSION_FILES += c/src/aclocal/version.m4
155VERSION_FILES += testsuites/aclocal/version.m4
156
157CVS_RUN := $(shell if [ -n "$(TAG_SUFFIX)" ]; then echo "cvs -n"; else echo "cvs"; fi)
158
159commit:
160        $(CVS_RUN) commit -m "Upgrade to $(rtems_version)" \
161          $(VERSION_FILES) VERSION
162
163.PHONY: commit new-minor new-revision new-branch tag tarball
Note: See TracBrowser for help on using the repository browser.