]> pd.if.org Git - pdclib.old/blob - Jamfile
[gandr] s/__lp64__/__LP64__/ to match GCC define
[pdclib.old] / Jamfile
1 SubDir PDCLIB_TOP ;
2 if $(PDCLIB_PLATFORM) {
3     SubInclude PDCLIB_TOP platform $(PDCLIB_PLATFORM) ;
4     SubDir PDCLIB_TOP ;
5 }
6 PDCLibConfig ;
7
8 PDCLIB_SOURCES = [ RecursiveGlob $(PDCLIB_TOP) : [ FDirName functions ] : *.c ] ;
9
10 if $(PDCLIB_PLATFORM) {
11     PDCLIB_PLATFORM_SOURCE_DIR = 
12         [ FDirName platform $(PDCLIB_PLATFORM) functions ] ;
13     PDCLIB_SOURCES += [ RecursiveGlob $(PDCLIB_TOP) : $(PDCLIB_PLATFORM_SOURCE_DIR) : *.c ] ;
14 }
15
16 for opt in $(PDCLIB_OPTIONS) {
17     optdir = [ FDirName opt $(opt) ] ;
18     PDCLIB_SOURCES += [ RecursiveGlob $(PDCLIB_TOP) : $(optdir) : *.c ] ;   
19 }
20
21 Library $(PDCLIB) : $(PDCLIB_SOURCES) ;
22
23 if ! $(PDCLIB_NO_TEST) {
24     for file in $(PDCLIB_SOURCES) {
25         testfile    = $(file:S=_t) ;
26         regtestfile = $(file:S=_r) ;
27         test        = $(file:S=-test) ;
28         regtest     = $(file:S=-regtest) ;
29
30         Object $(testfile).o    : $(file) ;
31         MainFromObjects $(testfile)    : $(testfile).o $(CRT0) ;
32         CCFLAGS on $(testfile).o += -DTEST $(PDCLIB_TEST_CCFLAGS) ;
33         LINKFLAGS on $(testfile)$(SUFEXE) += $(PDCLIB_TEST_LINKFLAGS) ;
34         LINKLIBS on $(testfile)$(SUFEXE) += $(PDCLIB_TEST_LINKLIBS) ;
35         LinkLibraries $(testfile) : $(PDCLIB) ;
36         Test    $(test)    : $(testfile) ;
37
38         if ! $(PDCLIB_NO_REGTEST) {
39             Object $(regtestfile).o : $(file) ;
40             MainFromObjects $(regtestfile) : $(regtestfile).o ;
41             CCFLAGS on $(regtestfile).o += -DTEST -DREGTEST 
42                                     $(PDCLIB_REGTEST_CCFLAGS) ;
43             CCHDRS on $(regtestfile).o = [ FIncludes [ FDirName testing ] ] $(PDCLIB_REGTEST_CCHDRS) ;
44             LINKFLAGS on $(regtestfile)$(SUFEXE) += $(PDCLIB_REGTEST_LINKFLAGS) ;
45             LINKLIBS on $(regtestfile)$(SUFEXE) += $(PDCLIB_REGTEST_LINKLIBS) ;
46             RegTest $(regtest) : $(regtestfile) ;
47         }
48     }
49
50     Main helloworld : helloworld.c ;
51     LinkLibraries helloworld : $(PDCLIB) ;
52     LINKLIBS on helloworld$(SUFEXE) += $(PDCLIB_TEST_LINKLIBS) ;
53     LINKFLAGS on helloworld$(SUFEXE) += $(PDCLIB_TEST_LINKFLAGS) ;
54 }
55
56 rule HtmlMan { 
57     DEPENDS htmlman : $(<) ;
58     DEPENDS $(<) : $(<:D) ;
59     DEPENDS $(<) : $(>) ;
60     MkDir $(<:D) ;
61 }
62
63 actions HtmlMan {
64     mandoc -Thtml -Oincludes=../3/%I.html -Oman=../%S/%N.html -Ostyle=../style.css $(>) >$(<)
65 }
66
67 for manpg in [ GLOB man3 : *.3 ] {
68     local section = [ SPLIT $(manpg:S) : . ] ;
69     HtmlMan [ FDirName html $(section) $(manpg:B).html ] : $(manpg) ;
70 }