added jam build system, please try it out - the advantage would be that it already...
[supertux.git] / mk / jam / unix.jam
1 #============================================================================
2 # Jam configuration and actions for Linux/Unix
3 #============================================================================
4 SHELL ?= "/bin/sh" ;
5
6 #----------------------------------------------------------------------------
7 # platform specific rules
8
9 ##  ConstructApplicationTarget target : options
10 ##    Constructs the application atrget name (ie. foo.exe for foo)
11 rule ConstructApplicationTarget
12 {
13     return $(<) ;
14 }
15 rule ConstructLibraryTarget
16 {
17     if [ IsElem shared : $(2) ] {
18         return lib$(<).la ;
19     } else {
20         return lib$(<).a ;
21     }
22 }
23 rule ConstructPluginTarget
24 {
25     return $(<).so ;
26 }
27
28 # SystemLinkApplication target : objects : options
29 #  do system specific actions needed for linking the application and construct
30 #  correct clean targets.
31 rule SystemLinkApplication
32 {
33     local target = $($(<)_TARGET) ;
34   
35     Depends $(target) : $(>) ;
36     LinkApplication $(target) : $(>) ;
37     # setup clean rules
38     Clean clean : $(target) ;
39     Clean $(<)clean : $(target) ;
40 }
41
42 actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
43 {
44     $(LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LFLAGS)
45 }
46
47