Option to jump with up on keyboard.
[supertux.git] / mk / jam / macosx.jam
1 #============================================================================
2 # Jam configuration and actions for MacOS/X
3 # Copyright (C) 2003 by Eric Sunshine <sunshine@sunshineco.com>
4 # Copyright (C) 2006 by Ondrej Hosek <ondra.hosek@gmail.com>
5 #============================================================================
6 SHELL ?= "/bin/sh" ;
7 DEEPCOPY ?= "cp -R" ;
8
9 # Experience seems to indicate that library scanning misbehaves on MacOS/X with
10 # Jam 2.4, consequently we disable it.
11 MACLIBTOOL = "libtool" ;
12 NOARUPDATE = true ;
13 NOARSCAN = true ;
14 actions Archive
15 {
16   $(MACLIBTOOL) -static -o $(<) $(>)
17 }
18
19 #------------------------------------------------------------------------------
20 # Public rules.
21 #------------------------------------------------------------------------------
22
23 # ConstructApplicationTarget target : options
24 #    Constructs the application target name (ie. foo.app for foo)
25 rule ConstructApplicationTarget
26 {
27   return $(<) ;
28 }
29
30 # ConstructLibraryTarget target : options
31 rule ConstructLibraryTarget
32 {
33   return lib$(<).a ;
34 }
35
36 # SystemLinkApplication target : objects : options
37 rule SystemLinkApplication
38 {
39   local target = $($(<)_TARGET) ;
40   Depends $(target) : $(>) ;
41
42   if [ IsElem linkerfile : $(3) ]
43   {
44     RemoveLinkerInputFile $(target) ;
45     local i ;
46     for i in $(>) { AppendLinkerInputFile $(target) : $(i) ; }
47     LinkApplicationFromFile $(target) : $(target) ;
48     RemoveLinkerInputFile $(target) ;
49   }
50   else
51   {
52     LinkApplication $(target) : $(>) ;
53   }
54
55   LIBS on $(target) = $(LIBS) ;
56   Clean clean : $(target) ;
57   Clean $(<)clean : $(target) ;
58 }
59
60 # LinkApplicationConsole exe : objects
61 #    Link a console (non-GUI) appliation from a set of object files.
62 actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
63 {
64   $(MACOSX.ENVIRON)
65   $(LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
66 }
67
68 actions quietly RemoveLinkerInputFile
69 {
70   $(RM) $(<).opt
71 }
72
73 actions quietly together piecemeal AppendLinkerInputFile
74 {
75   echo $(>) >> $(<).opt
76 }
77
78 actions LinkApplicationFromFile bind NEEDLIBS bind EXTRAOBJECTS
79 {
80   $(MACOSX.ENVIRON)
81   $(LINK) -o $(<) `cat $(>).opt` $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
82 #  $(LINK) -o $(<) -Xlinker @$(>).opt $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
83 }
84
85 # Fix a Bison quirk... headers for ".cpp" are made ".cpp.h" (not ".hpp")
86 # under OS X
87 if $(BISON)
88 {
89   actions Bison
90   {
91     $(BISON) -d $(BISON_FLAGS) -o $(<[1]) $(>)
92     test -f $(<[1]).h && $(MV) $(<[1]).h $(<[2])
93   }
94 }