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 ;
62 # ld64 does automatic repeated searches of archives
63 # and doesn't accept --start-group/--end-group
65 #actions Link bind NEEDLIBS
67 # $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
70 actions Link bind NEEDLIBS
72 $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) -Wl,--start-group $(NEEDLIBS) $(LINKLIBS) -Wl,--end-group
75 } else if $(PDCLIB_TOOLCHAIN) = "WATCOM" {
77 CCFLAGS = /zq /DWIN32 /zls ;
78 C++FLAGS = /zq /DWIN32 /zls ;
79 STDHDRS = $(WATCOM)\\h\\nt ;
80 PDCLIB_CCFLAGS = "-za99 -zl -s" ;
82 ECHO The value of PDCLIB_TOOLCHAIN is not recognized ;
83 ECHO Currently set to $(PDCLIB_TOOLCHAIN) ;
87 if $(PDCLIB_PLATFORM) {
88 include [ FDirName $(PDCLIB_TOP) platform $(PDCLIB_PLATFORM) Config.jam ] ;
92 SubDirHdrs $(PDCLIB_TOP) includes ;
93 SubDirHdrs $(PDCLIB_TOP) internals ;
94 SubDirHdrs $(PDCLIB_TOP) testing ;
95 for opt in $(PDCLIB_OPTIONS) {
96 SubDirHdrs $(PDCLIB_TOP) opt $(opt) ;
102 SubDirCcFlags $(PDCLIB_CCFLAGS) ;
103 SubDirC++Flags $(PDCLIB_C++FLAGS) ;
108 # MinGW needs appropriate prodding to cretae executables
109 if $(TOOLSET) = MINGW {
110 PDCLIB_TEST_LINKFLAGS += -mconsole ;
111 PDCLIB_REGTEST_LINKFLAGS += -mconsole ;
115 ALWAYS regtest test ;
118 DEPENDS $(<) : $(>) ;
120 DEPENDS test : $(<) ;
124 DEPENDS $(<) : $(>) ;
126 DEPENDS regtest : $(<) ;
137 # list all files in a directory, except ., ..
138 # [ ListDir base : dirname ]
140 # start with empty list
143 # for each file in the directory
144 local _dirlist = [ GLOB [ FDirName $(1) $(2) ] : * ] ;
145 for _subdir in $(_dirlist) {
147 # if it is not . or ..
149 case *\\. : _dummy = "" ; # is there some no-op statement?
150 case *\\.. : _dummy = "" ; # is there some no-op statement?
153 _result += $(_subdir:D=$(2)) ;
157 # return resulting list
161 # same as glob, but recurses into subdirs
163 # initially use the files in the current directory
165 local _path = [ FDirName $(1) $(2) ] ;
166 local _result = [ GLOB $(_path) : $(3) ] ;
167 _result = $(_result:D=$(_dir)) ;
169 # list all subdirectories (and files, but it doesn't hurt)
170 local _subdirlist = [ ListDir $(1) : $(2) ] ;
172 # for each subdir/file
173 for _subdir in $(_subdirlist) {
175 _result += [ RecursiveGlob $(1) : $(_subdir) : $(3) ] ;
178 # return the resulting list
182 # Fix to work on targets in subdirs
185 # Note we grist the directory name with 'dir',
186 # so that directory path components and other
187 # targets don't conflict.
191 local _rev = [ FReverse $(>) ] ;
192 if $(_rev[1]) = "." {
195 local _dir = [ FDirName [ FReverse $(_rev) ] $(<[0]:D) ] ;
197 LOCATE on $(<) = [ FDirName $(>) ] ;
198 Depends $(<) : $(_dir:G=dir) ;
199 MkDir $(_dir:G=dir) ;