AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only

AIX5.2, makefile problem---append macro value

  • 1.  AIX5.2, makefile problem---append macro value

    Posted Fri October 23, 2009 03:21 AM

    Originally posted by: gerald li


    hi,
    I encounter a problem under AIX5.2, I need to write a makefile, and I I have a macro defined as follows:

    YY = ab

    In the following part somewhere in the same makefile, I need expand the YY's value as "ab cd", then I wrote it like the following, appending a value "cd" after the original YY variable:

    YY = $(YY) cd

    Now the problem emerge, the make command will report the following error:
    make: 1254-033 A macro cannot define itself:YY
    It doesn't support the YY = $(YY) usage
    but this makefile works fine under AIX5.3

    Can anyone give me some good suggestion, How can I support the value appending feature under AIX5.2?

    If I have a YY defined as "ab", how can I update it to "ab cd", of course I can't directly use YY = ab cd, because "ab cd" just a sample, the orignal YY's value can be very complex, I also can't change the original YY's name to XX, such as
    XX=ab

    then:
    YY = $(XX) ab

    I know this can solve problem, but the original YY's value's logic is also very complex, It not proper to change its name to XX

    thanks