| 121 | | # Default value. Mostly for the sake of clang-linux |
| 122 | | # that inherits from gcc, but does not has the same |
| 123 | | # logic to set the .AR variable. We can put the same |
| 124 | | # logic in clang-linux, but that's hardly worth the trouble |
| 125 | | # as on Linux, 'ar' is always available. |
| 126 | | .AR = ar ; |
| 127 | | |
| 128 | | rule archive ( targets * : sources * : properties * ) |
| 129 | | { |
| 130 | | # Always remove archive and start again. Here's rationale from |
| 131 | | # Andre Hentz: |
| 132 | | # |
| 133 | | # I had a file, say a1.c, that was included into liba.a. |
| 134 | | # I moved a1.c to a2.c, updated my Jamfiles and rebuilt. |
| 135 | | # My program was crashing with absurd errors. |
| 136 | | # After some debugging I traced it back to the fact that a1.o was *still* |
| 137 | | # in liba.a |
| 138 | | # |
| 139 | | # Rene Rivera: |
| 140 | | # |
| 141 | | # Originally removing the archive was done by splicing an RM |
| 142 | | # onto the archive action. That makes archives fail to build on NT |
| 143 | | # when they have many files because it will no longer execute the |
| 144 | | # action directly and blow the line length limit. Instead we |
| 145 | | # remove the file in a different action, just before the building |
| 146 | | # of the archive. |
| 147 | | # |
| 148 | | local clean.a = $(targets[1])(clean) ; |
| 149 | | TEMPORARY $(clean.a) ; |
| 150 | | NOCARE $(clean.a) ; |
| 151 | | LOCATE on $(clean.a) = [ on $(targets[1]) return $(LOCATE) ] ; |
| 152 | | DEPENDS $(clean.a) : $(sources) ; |
| 153 | | DEPENDS $(targets) : $(clean.a) ; |
| 154 | | common.RmTemps $(clean.a) : $(targets) ; |
| 155 | | } |
| | 121 | .LIBTOOL = libtool ; |