make/common/JavaCompilation.gmk

changeset 1028
feeb67be5886
parent 978
c5a60709f587
child 1133
50aaf272884f
child 2519
908e7985b339
     1.1 --- a/make/common/JavaCompilation.gmk	Mon Mar 31 14:06:57 2014 -0700
     1.2 +++ b/make/common/JavaCompilation.gmk	Wed Apr 02 10:01:38 2014 -0700
     1.3 @@ -163,11 +163,12 @@
     1.4  
     1.5    # The capture contents macro finds all files (matching the patterns, typically
     1.6    # .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar.
     1.7 +  # NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
     1.8    $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \
     1.9 -      (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \
    1.10 +      ( ( $(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \
    1.11            $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \
    1.12 -      $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES))) > \
    1.13 -      $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE))
    1.14 +      $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES) ) ) > \
    1.15 +      $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
    1.16    # The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file.
    1.17    ifeq (,$$($1_SKIP_METAINF))
    1.18      $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE))
    1.19 @@ -176,19 +177,20 @@
    1.20    # tells us what to remove from the jar-file.
    1.21    $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE))
    1.22    # The update contents macro updates the jar file with the previously capture contents.
    1.23 -  # xargs is used to trim the whitespace from the contents file, to see if it is empty.
    1.24 +  # Use 'wc -w' to see if the contents file is empty.
    1.25    $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS), \
    1.26        (cd $$(src) && \
    1.27 -       if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \
    1.28 +       if [ "`$(WC) -w _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \
    1.29           $(ECHO) "  updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
    1.30           $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \
    1.31         fi) $$(NEWLINE))
    1.32    # The s-variants of the above macros are used when the jar is created from scratch.
    1.33 +  # NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
    1.34    $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \
    1.35 -      (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
    1.36 +      ( ( $(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
    1.37            $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \
    1.38 -      $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES))) > \
    1.39 -      $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE))
    1.40 +      $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES) ) ) > \
    1.41 +      $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
    1.42  
    1.43    ifeq (,$$($1_SKIP_METAINF))
    1.44      $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS), \

mercurial