[e6a00cae] | 1 | # |
---|
| 2 | # Maintainer Makefile |
---|
| 3 | # |
---|
| 4 | |
---|
| 5 | # WARNING: |
---|
[294030f5] | 6 | |
---|
| 7 | # THIS IS EXPERIMENTAL - DO NOT USE (YET) ! |
---|
| 8 | |
---|
[e6a00cae] | 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 |
---|
[859fbb49] | 20 | # 2. Run "make -f Makefile.maint new-revision" |
---|
| 21 | # (rsp. "make -f Makefile.maint new-minor"). |
---|
[294030f5] | 22 | # 3. Run "make -f Makefile.maint commit" |
---|
| 23 | # 4. Run "make -f Makefile.maint tag" |
---|
| 24 | # 5. Run "make -f Makefine.maint tarball" |
---|
[e6a00cae] | 25 | |
---|
| 26 | # ----------------- |
---|
[294030f5] | 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>" |
---|
[e6a00cae] | 29 | TEST_TAG = -test1 |
---|
| 30 | |
---|
[8b75a07] | 31 | rtems_version := $(shell cat VERSION | sed -n '/.* Version /{s/^.*Version[ ]*\([0-9\.]\+\)/\1/p};') |
---|
[e6a00cae] | 32 | rtems_tag := $(shell echo "rtems-$(rtems_version)" | tr . -) |
---|
| 33 | |
---|
| 34 | # ----------------- |
---|
| 35 | # Cleanup check out and cvs-tag the files inside |
---|
| 36 | tag: |
---|
| 37 | cvs -z9 up -dP >/dev/null |
---|
| 38 | @./bootstrap -p >/dev/null |
---|
| 39 | cvs tag -c $(rtems_tag)$(TEST_TAG) >/dev/null |
---|
| 40 | |
---|
| 41 | # ----------------- |
---|
| 42 | # Different stages of cvs-exporting |
---|
| 43 | rtems-$(rtems_version)/stamp.export: |
---|
[039970a] | 44 | @cvs -z9 export -d rtems-$(rtems_version) -r $(rtems_tag)$(TEST_TAG) rtems |
---|
| 45 | @if ! test -d rtems-$(rtems_version)/VERSION; then \ |
---|
| 46 | echo "ERROR export failed"; \ |
---|
| 47 | echo " Did you run 'make -f Makefile.maint tag' ?"; fi; exit 1 |
---|
[e6a00cae] | 48 | touch rtems-$(rtems_version)/stamp.export |
---|
| 49 | |
---|
| 50 | rtems-$(rtems_version).tar.bz2: rtems-$(rtems_version)/stamp.autofiles rtems-$(rtems_version)/excludes |
---|
| 51 | tar -cj -X rtems-$(rtems_version)/excludes \ |
---|
| 52 | -f rtems-$(rtems_version).tar.bz2 rtems-$(rtems_version) |
---|
| 53 | |
---|
| 54 | rtems-$(rtems_version)/stamp.cleanup: rtems-$(rtems_version)/stamp.export |
---|
| 55 | find rtems-$(rtems_version) -name .cvsignore -exec rm -f {} \; |
---|
| 56 | find rtems-$(rtems_version) -name preinstall.am -exec touch {} \; |
---|
| 57 | touch rtems-$(rtems_version)/c/src/librdbg/src/*/*/remdeb*.[hc] |
---|
| 58 | rm -rf rtems-$(rtems_version)/contrib |
---|
| 59 | touch rtems-$(rtems_version)/stamp.cleanup |
---|
| 60 | |
---|
| 61 | rtems-$(rtems_version)/stamp.autofiles: rtems-$(rtems_version)/stamp.cleanup |
---|
| 62 | cd rtems-$(rtems_version) && ./bootstrap -r |
---|
| 63 | touch rtems-$(rtems_version)/stamp.autofiles |
---|
| 64 | |
---|
| 65 | rtems-$(rtems_version)/excludes: Makefile.maint |
---|
| 66 | @echo "Generating $@" |
---|
| 67 | @echo "excludes" > $@ |
---|
| 68 | @echo "stamp.*" >> $@ |
---|
| 69 | @echo "autom4te.cache" >> $@ |
---|
| 70 | @echo "Makefile.maint" >> $@ |
---|
| 71 | |
---|
| 72 | tarball: rtems-$(rtems_version).tar.bz2 |
---|
| 73 | |
---|
| 74 | # ----------------- |
---|
[859fbb49] | 75 | # Create a new minor release |
---|
[e6a00cae] | 76 | # increments the 2nd digit of the version number |
---|
| 77 | # set the 3rd digit of the version number to 0 |
---|
| 78 | # Example: 4.6.99.4 -> 4.7.0 |
---|
[859fbb49] | 79 | new-minor: |
---|
[e6a00cae] | 80 | @v=$$(echo $(rtems_version) | sed 's,^\([0-9]\+\).*,\1,'); \ |
---|
| 81 | r=$$(echo $(rtems_version) | sed 's,^[0-9]\+\.\([0-9]\+\).*,\1,'); \ |
---|
| 82 | r=$$(($$r + 1)); version="$$v.$$r.0"; \ |
---|
[859fbb49] | 83 | echo "New minor release: $$version"; \ |
---|
[e6a00cae] | 84 | sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \ |
---|
[8b75a07] | 85 | $(VERSION_FILES); \ |
---|
| 86 | sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION |
---|
[e6a00cae] | 87 | |
---|
[859fbb49] | 88 | # Create a new revision release |
---|
[e6a00cae] | 89 | # increments the last digit of the version number |
---|
| 90 | # Examples: 4.6.99.4 -> 4.6.99.5 |
---|
| 91 | # 4.7.0 -> 4.7.1 |
---|
[859fbb49] | 92 | new-revision: |
---|
[e6a00cae] | 93 | @m=$$(echo $(rtems_version) | sed 's,^\(.*\)\.[0-9]\+,\1,'); \ |
---|
| 94 | n=$$(echo $(rtems_version) | sed 's,^.*\.\([0-9]\+\),\1,'); \ |
---|
| 95 | n=$$(($$n + 1)); version="$$m.$$n";\ |
---|
[859fbb49] | 96 | echo "New revision release: $$version"; \ |
---|
[e6a00cae] | 97 | sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \ |
---|
[8b75a07] | 98 | $(VERSION_FILES); \ |
---|
| 99 | sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION |
---|
[e6a00cae] | 100 | |
---|
| 101 | VERSION_FILES += aclocal/version.m4 |
---|
| 102 | VERSION_FILES += cpukit/aclocal/version.m4 |
---|
| 103 | VERSION_FILES += c/src/aclocal/version.m4 |
---|
| 104 | VERSION_FILES += testsuites/aclocal/version.m4 |
---|
| 105 | |
---|
[952a969] | 106 | CVS_RUN := $(shell if [ -n "$(TEST_TAG)" ]; then echo "cvs -n"; else echo "cvs"; fi) |
---|
| 107 | |
---|
[294030f5] | 108 | commit: |
---|
[952a969] | 109 | $(CVS_RUN) commit -m "Upgrade to $(rtems_version)" \ |
---|
[8b75a07] | 110 | $(VERSION_FILES) VERSION |
---|
[294030f5] | 111 | |
---|
[859fbb49] | 112 | .PHONY: commit new-minor new-revision tag tarball |
---|