2 if $(PDCLIB_PLATFORM) {
3 SubInclude PDCLIB_TOP platform $(PDCLIB_PLATFORM) ;
8 PDCLIB_SOURCES = [ RecursiveGlob $(PDCLIB_TOP) : [ FDirName functions ] : *.c ] ;
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 ] ;
16 for opt in $(PDCLIB_OPTIONS) {
17 optdir = [ FDirName opt $(opt) ] ;
18 PDCLIB_SOURCES += [ RecursiveGlob $(PDCLIB_TOP) : $(optdir) : *.c ] ;
21 Library $(PDCLIB) : $(PDCLIB_SOURCES) ;
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) ;
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) ;
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) ;
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) ;
57 DEPENDS htmlman : $(<) ;
58 DEPENDS $(<) : $(<:D) ;
64 mandoc -Thtml -Oincludes=../3/%I.html -Oman=../%S/%N.html -Ostyle=../style.css $(>) >$(<)
67 for manpg in [ GLOB man3 : *.3 ] {
68 local section = [ SPLIT $(manpg:S) : . ] ;
69 HtmlMan [ FDirName html $(section) $(manpg:B).html ] : $(manpg) ;