3 ECHO "PDCLIB_TOP: " $(PDCLIB_TOP) ;
\r
5 if ! $(PDCLIB_HAVE_PLATFORM) && ! $(PDCLIB_PLATFORM) {
\r
7 PDCLIB_PLATFORM = "win32" ;
\r
9 PDCLIB_PLATFORM = "posix" ;
\r
11 ECHO "PDCLIB_PLATFORM not set and platform not automatically detected" ;
\r
12 ECHO "Set PDCLIB_PLATFORM to the platform to be built for" ;
\r
15 PDCLIB_HAVE_PLATFORM = 1 ;
\r
19 # TODO: Better toolchain handling
\r
21 # No -Wcast-align : spurious warnings when using char* to do pointer
\r
23 # No -Winline : when compiling with e.g. -Os causes spurious
\r
24 # warnings that call is unlikely/code size would grow
\r
25 # No -Wredundant-decls : some functions must be multiply defined
\r
27 -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow
\r
28 -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wno-long-long
\r
31 PDCLIB_CCWARNINGS ?=
\r
32 -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes ;
\r
39 $(PDCLIB_WARNINGS) ;
\r
46 $(PDCLIB_WARNINGS) ;
\r
48 actions Link bind NEEDLIBS
\r
50 $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) -Wl,--start-group $(NEEDLIBS) $(LINKLIBS) -Wl,--end-group
\r
54 if $(PDCLIB_PLATFORM) {
\r
55 include [ FDirName $(PDCLIB_TOP) platform $(PDCLIB_PLATFORM) Config.jam ] ;
\r
58 rule PDCLibHeaders {
\r
59 SubDirHdrs $(PDCLIB_TOP) includes ;
\r
60 SubDirHdrs $(PDCLIB_TOP) internals ;
\r
61 SubDirHdrs $(PDCLIB_TOP) testing ;
\r
62 for opt in $(PDCLIB_OPTIONS) {
\r
63 SubDirHdrs $(PDCLIB_TOP) opt $(opt) ;
\r
65 PDCLibTargetHeaders ;
\r
69 SubDirCcFlags $(PDCLIB_CCFLAGS) ;
\r
70 SubDirC++Flags $(PDCLIB_C++FLAGS) ;
\r
72 PDCLibTargetConfig ;
\r
75 # MinGW needs appropriate prodding to cretae executables
\r
76 if $(TOOLSET) = MINGW {
\r
77 PDCLIB_TEST_LINKFLAGS += -mconsole ;
\r
78 PDCLIB_REGTEST_LINKFLAGS += -mconsole ;
\r
82 ALWAYS regtest test ;
\r
85 DEPENDS $(<) : $(>) ;
\r
87 DEPENDS test : $(<) ;
\r
91 DEPENDS $(<) : $(>) ;
\r
93 DEPENDS regtest : $(<) ;
\r
104 # list all files in a directory, except ., ..
\r
105 # [ ListDir base : dirname ]
\r
107 # start with empty list
\r
110 # for each file in the directory
\r
111 local _dirlist = [ GLOB [ FDirName $(1) $(2) ] : * ] ;
\r
112 for _subdir in $(_dirlist) {
\r
114 # if it is not . or ..
\r
115 switch $(_subdir) {
\r
116 case *\\. : _dummy = "" ; # is there some no-op statement?
\r
117 case *\\.. : _dummy = "" ; # is there some no-op statement?
\r
119 # add it to the list
\r
120 _result += $(_subdir:D=$(2)) ;
\r
124 # return resulting list
\r
125 return $(_result) ;
\r
128 # same as glob, but recurses into subdirs
\r
129 rule RecursiveGlob {
\r
130 # initially use the files in the current directory
\r
131 local _dir = $(2) ;
\r
132 local _path = [ FDirName $(1) $(2) ] ;
\r
133 local _result = [ GLOB $(_path) : $(3) ] ;
\r
134 _result = $(_result:D=$(_dir)) ;
\r
136 # list all subdirectories (and files, but it doesn't hurt)
\r
137 local _subdirlist = [ ListDir $(1) : $(2) ] ;
\r
139 # for each subdir/file
\r
140 for _subdir in $(_subdirlist) {
\r
142 _result += [ RecursiveGlob $(1) : $(_subdir) : $(3) ] ;
\r
145 # return the resulting list
\r
146 return $(_result) ;
\r
149 # Fix to work on targets in subdirs
\r
152 # Note we grist the directory name with 'dir',
\r
153 # so that directory path components and other
\r
154 # targets don't conflict.
\r
158 local _rev = [ FReverse $(>) ] ;
\r
159 if $(_rev[1]) = "." {
\r
160 _rev = $(_rev[2-]) ;
\r
162 local _dir = [ FDirName [ FReverse $(_rev) ] $(<[0]:D) ] ;
\r
164 LOCATE on $(<) = [ FDirName $(>) ] ;
\r
165 Depends $(<) : $(_dir:G=dir) ;
\r
166 MkDir $(_dir:G=dir) ;
\r