source: trunk/Jamrules @ 1

Last change on this file since 1 was 1, checked in by root, 15 years ago

Import from 2005-10-26

File size: 2.3 KB
Line 
1include config.jam ;
2
3if ! $(DEFINES)
4{
5    Exit "Please run ./configure first." ;
6}
7
8VERSION_MAJOR  = 0 ;
9VERSION_MINOR  = 3 ;
10VERSION_STRING = $(VERSION_MAJOR).$(VERSION_MINOR) ;
11
12DEFINES += VERSION_MAJOR=$(VERSION_MAJOR)
13           VERSION_MINOR=$(VERSION_MINOR)
14           VERSION_STRING=\\\"$(VERSION_STRING)\\\" ;
15CCFLAGS  = -g -Wall -W ;
16OPTIM    = -O3 ;
17RM       = rm -Rf ;
18
19if $(OS) = MACOSX
20{
21    # Build universal binaries
22    CCFLAGS   += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
23                 -arch ppc -arch i386 ;
24    LINKFLAGS += -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
25                 -arch ppc -arch i386 ;
26
27    # Use libtool to build static libraries (ar does not handle
28    # universal binaries)
29    RANLIB     =   ;
30    NOARUPDATE = 1 ;
31    actions Archive
32    {
33        libtool -static $(>) -o $(<) ;
34    }
35
36    rule OSXInfoPlist
37    {
38        Depends        $(1)  : $(2) ;
39        Clean          clean : $(1) ;
40    }
41    actions OSXInfoPlist
42    {
43        sed "s/%%VERSION%%/$(VERSION_STRING)/" < $(2) > $(1)
44    }
45
46    rule OSXBundle
47    {   
48        Depends     exe   : $(1) ;
49        Depends     $(1)  : $(2) ;
50        Clean       clean : $(1) macosx/build ;
51    }
52    actions OSXBundle
53    {   
54        $(RM) $(1) && ( cd macosx && xcodebuild ) && \
55          mv macosx/build/Debug/Transmission.app $(1)
56    }
57
58    rule OSXPackage
59    {
60        Depends      $(1)  : $(2) ;
61        Clean        clean : $(1) ;
62        DoOSXPackage $(1) ;
63    }
64    actions DoOSXPackage
65    {
66        TMP="Transmission $(VERSION_STRING)"
67        rm -f $(1) "$TMP" && mkdir "$TMP" &&
68        mkdir "$TMP/Transmission.app" &&
69        ditto Transmission.app "$TMP/Transmission.app" &&
70        ditto AUTHORS "$TMP/AUTHORS.txt" &&
71        ditto LICENSE "$TMP/LICENSE.txt" &&
72        ditto NEWS "$TMP/NEWS.txt" &&
73        ( echo "[InternetShortcut]"; \
74          echo "URL=http://transmission.m0k.org/" ) > \
75          "$TMP/Homepage.url" &&
76        ( echo "[InternetShortcut]"; \
77          echo "URL=http://transmission.m0k.org/forum/" ) > \
78          "$TMP/Forums.url" &&
79        ( echo "[InternetShortcut]"; \
80          echo "URL=http://transmission.m0k.org/contribute.php" ) > \
81          "$TMP/Contribute.url" &&
82        hdiutil create -format UDZO -srcfolder "$TMP" $(1) &&
83        rm -rf "$TMP"
84    }
85}
Note: See TracBrowser for help on using the repository browser.