Changeset 265 for trunk/Makefile


Ignore:
Timestamp:
May 31, 2006, 12:54:53 PM (17 years ago)
Author:
titer
Message:

Split and moved makefiles into a seperate folder, fixes and speed-up to
the retrieving of the SVN revision, OS X packages now show the revision
if this isn't a release build

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 Makefile.config
        2 Makefile.version
        31.depend
        42build
  • trunk/Makefile

    r264 r265  
    11# $Id$
    22
    3 -include Makefile.config
    4 ifndef CONFIGURE_RUN
    5 $(error You must run ./configure first)
     3include mk/common.mk
     4
     5default: all
     6
     7# Before we do anything else, make sure we have config.mk and an
     8# updated version.mk
     9
     10required: mk/config.mk mk/version.mk
     11mk/config.mk:
     12        @echo "Please run ./configure first."
     13        @false
     14mk/version.mk: FORCE
     15        @echo "Checking SVN revision..."
     16        @./version.sh
     17FORCE:
     18
     19# Now call the Makefile that'll really build
     20# OS X has its special Makefile that wraps to Xcode
     21
     22-include mk/config.mk
     23ifneq ($(SYSTEM),Darwin)
     24REALMAKE = $(MAKE) -f mk/default.mk
     25else
     26REALMAKE = $(MAKE) -f mk/osx.mk
    627endif
    728
    8 -include Makefile.version
    9 include Makefile.common
    10 
    11 ifneq ($(SYSTEM),Darwin)
    12 
    13 TARGETS = .cli
    14 ifeq ($(GTK),yes)
    15 TARGETS += .gtk
    16 endif
    17 ifeq ($(SYSTEM),BeOS)
    18 TARGETS += .beos
    19 endif
    20 
    21 all: $(TARGETS)
    22 
    23 .lib: .version
    24         @echo "* Building libtransmission"
    25         @$(MAKE) -C libtransmission
    26 
    27 .cli: .lib
    28         @echo "* Building Transmission CLI client"
    29         @$(MAKE) -C cli
    30 
    31 .gtk: .lib
    32         @echo "* Building Transmission GTK+ client"
    33         @$(MAKE) -C gtk
    34 
    35 .beos: .lib
    36         @echo "* Building Transmission BeOS client"
    37         @make -C beos
    38 
    39 install: all $(foreach SUB,$(TARGETS),.install$(SUB))
    40 
    41 .install.cli: .cli
    42         @echo "* Installing Transmission CLI client"
    43         @$(MAKE) -C cli install
    44 
    45 .install.gtk: .gtk
    46         @echo "* Installing Transmission GTK+ client"
    47         @$(MAKE) -C gtk install
    48 
    49 .install.beos:
    50 
    51 clean:
    52         @$(MAKE) -C libtransmission clean
    53         @$(MAKE) -C cli clean
    54 ifeq ($(GTK),yes)
    55         @$(MAKE) -C gtk clean
    56 endif
    57 ifeq ($(SYSTEM),BeOS)
    58         @$(MAKE) -C beos clean
    59 endif
    60 
    61 else
    62 
    63 all: .version
    64         @$(MAKE) -C macosx
    65         @xcodebuild -alltargets -activeconfiguration | grep -v "^$$"
    66 
    67 clean:
    68         @xcodebuild -alltargets -activeconfiguration clean | grep -v "^$$"
    69         @$(MAKE) -C macosx clean
    70 
    71 MAKELINK = printf "[InternetShortcut]\nURL=http://transmission.m0k.org%s\n"
    72 define PACKAGE_RULE1
    73         $(RM) tmp "Transmission $(VERSION_STRING)" \
    74           Transmission-$(VERSION_STRING).dmg
    75         mkdir -p tmp
    76         cp -r macosx/Transmission.app tmp/
    77         cp AUTHORS tmp/AUTHORS.txt
    78         cp LICENSE tmp/LICENSE.txt
    79         cp NEWS tmp/NEWS.txt
    80         $(MAKELINK) "/" > tmp/Homepage.url
    81         $(MAKELINK) "/forum" > tmp/Forums.url
    82         $(MAKELINK) "/contribute.php" > tmp/Contribute.url
    83 endef
    84 define PACKAGE_RULE2
    85         mv tmp "Transmission $(VERSION_STRING)"
    86         hdiutil create -format UDZO -srcfolder \
    87           "Transmission $(VERSION_STRING)" Transmission-$(VERSION_STRING).dmg
    88         rm -rf "Transmission $(VERSION_STRING)"
    89 endef
    90 
    91 package:
    92         $(PACKAGE_RULE1)
    93         $(PACKAGE_RULE2)
    94 
    95 package-release:
    96         $(PACKAGE_RULE1)
    97         strip -S tmp/Transmission.app/Contents/MacOS/Transmission
    98         $(PACKAGE_RULE2)
    99 
    100 endif
    101 
    102 .version: .version1 .version2
    103 
    104 .version1:
    105         @echo "Checking SVN revision..."
    106         @./version.sh
    107 
    108 .version2:
    109         @$(RM) libtransmission/version.h
    110         @( echo "#define VERSION_MAJOR    $(VERSION_MAJOR)" && \
    111            echo "#define VERSION_MINOR    $(VERSION_MINOR)" && \
    112            echo "#define VERSION_STRING   \"$(VERSION_STRING)\"" && \
    113            echo "#define VERSION_REVISION $(VERSION_REVISION)" ) > \
    114            libtransmission/version.h
    115 
    116 Makefile.version: .version1
     29all: required
     30        @$(REALMAKE) all
     31clean: required
     32        @$(REALMAKE) clean
     33install: required
     34        @$(REALMAKE) install
     35package: required
     36        @$(REALMAKE) package
     37package-release: required
     38        @$(REALMAKE) package-release
Note: See TracChangeset for help on using the changeset viewer.