3 ECHO "PDCLIB_TOP: " $(PDCLIB_TOP) ;
5 if ! $(PDCLIB_HAVE_PLATFORM) && ! $(PDCLIB_PLATFORM) {
7 PDCLIB_PLATFORM = "win32" ;
9 PDCLIB_PLATFORM = "posix" ;
11 ECHO PDCLIB_PLATFORM not set and platform not automatically detected ;
12 ECHO Set PDCLIB_PLATFORM to the platform to be built for ;
15 PDCLIB_HAVE_PLATFORM = 1 ;
18 if $(PDCLIB_TOOLCHAIN) = "" {
19 local __ccparts = [ SPLIT $(CC) : "-" ] ;
20 if $(JAM_TOOLSET) = "MINGW" || "gcc" in $(__ccparts)
21 || "clang" in $(__ccparts) {
23 PDCLIB_TOOLCHAIN = "gcc" ;
24 } else if $(JAM_TOOLSET) != "" {
25 PDCLIB_TOOLCHAIN = $(JAM_TOOLSET) ;
27 ECHO PDCLIB_TOOLCHAIN is unset and I can't glean what toolset is being ;
28 ECHO used from your environment. Please set it. ;
33 if $(PDCLIB_TOOLCHAIN) = "gcc" {
34 # No -Wcast-align : spurious warnings when using char* to do pointer
36 # No -Winline : when compiling with e.g. -Os causes spurious
37 # warnings that call is unlikely/code size would grow
38 # No -Wredundant-decls : some functions must be multiply defined
40 -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow
41 -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wno-long-long
45 -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes ;
66 # ld64 does automatic repeated searches of archives
67 # and doesn't accept --start-group/--end-group
69 #actions Link bind NEEDLIBS
71 # $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
74 PDCLIB_TEST_LINKFLAGS += -Wl,--gc-sections ;
75 actions Link bind NEEDLIBS
77 $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) -Wl,--start-group $(NEEDLIBS) $(LINKLIBS) -Wl,--end-group
80 } else if $(PDCLIB_TOOLCHAIN) = "WATCOM" {
82 CCFLAGS = /zq /DWIN32 /zls ;
83 C++FLAGS = /zq /DWIN32 /zls ;
84 STDHDRS = $(WATCOM)\\h\\nt ;
85 PDCLIB_CCFLAGS = "-za99 -zl -s" ;
87 ECHO The value of PDCLIB_TOOLCHAIN is not recognized ;
88 ECHO Currently set to $(PDCLIB_TOOLCHAIN) ;
92 if $(PDCLIB_PLATFORM) {
93 include [ FDirName $(PDCLIB_TOP) platform $(PDCLIB_PLATFORM) Config.jam ] ;
97 SubDirHdrs $(PDCLIB_TOP) includes ;
98 SubDirHdrs $(PDCLIB_TOP) internals ;
99 SubDirHdrs $(PDCLIB_TOP) testing ;
100 for opt in $(PDCLIB_OPTIONS) {
101 SubDirHdrs $(PDCLIB_TOP) opt $(opt) ;
103 PDCLibTargetHeaders ;
107 SubDirCcFlags $(PDCLIB_CCFLAGS) ;
108 SubDirC++Flags $(PDCLIB_C++FLAGS) ;
113 # MinGW needs appropriate prodding to cretae executables
114 if $(TOOLSET) = MINGW {
115 PDCLIB_TEST_LINKFLAGS += -mconsole ;
116 PDCLIB_REGTEST_LINKFLAGS += -mconsole ;
120 ALWAYS regtest test ;
123 DEPENDS $(<) : $(>) ;
125 DEPENDS test : $(<) ;
129 DEPENDS $(<) : $(>) ;
131 DEPENDS regtest : $(<) ;
142 # list all files in a directory, except ., ..
143 # [ ListDir base : dirname ]
145 # start with empty list
148 # for each file in the directory
149 local _dirlist = [ GLOB [ FDirName $(1) $(2) ] : * ] ;
150 for _subdir in $(_dirlist) {
152 # if it is not . or ..
154 case *\\. : _dummy = "" ; # is there some no-op statement?
155 case *\\.. : _dummy = "" ; # is there some no-op statement?
158 _result += $(_subdir:D=$(2)) ;
162 # return resulting list
166 # same as glob, but recurses into subdirs
168 # initially use the files in the current directory
170 local _path = [ FDirName $(1) $(2) ] ;
171 local _result = [ GLOB $(_path) : $(3) ] ;
172 _result = $(_result:D=$(_dir)) ;
174 # list all subdirectories (and files, but it doesn't hurt)
175 local _subdirlist = [ ListDir $(1) : $(2) ] ;
177 # for each subdir/file
178 for _subdir in $(_subdirlist) {
180 _result += [ RecursiveGlob $(1) : $(_subdir) : $(3) ] ;
183 # return the resulting list
187 # Fix to work on targets in subdirs
190 # Note we grist the directory name with 'dir',
191 # so that directory path components and other
192 # targets don't conflict.
196 local _rev = [ FReverse $(>) ] ;
197 if $(_rev[1]) = "." {
200 local _dir = [ FDirName [ FReverse $(_rev) ] $(<[0]:D) ] ;
202 LOCATE on $(<) = [ FDirName $(>) ] ;
203 Depends $(<) : $(_dir:G=dir) ;
204 MkDir $(_dir:G=dir) ;