help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New features: preprocessing (-P switch), $(pack), $(unpack), $(callwords


From: Rafi Einstein
Subject: New features: preprocessing (-P switch), $(pack), $(unpack), $(callwords)
Date: Thu, 26 Oct 2006 20:46:59 +0200

Feature: preprocessing output (something similar to -E in C compilers)

 

            With this feature, make invoked with the -P switch will dump the entire “compilation unit” (including contents of include files), and quit.

            Macros are not expanded.

            Results of $(eval ...) are printed as comments.

 

Feature: $(pack list) and $(unpack packed-list) functions

 

            By example:

                        $(pack a b c) => (a,b,c)

                        $(unpack (a,b,c)) => a b c

                        $(pack (a,b) (x,y,z)) => ((a,b),(x,y,z))

            Useful for dealing with structured information, such as:

            DEPENDS += $(pack module-name module-dir)

            ...

            MODULE_NAMES=$(for D,$(DEPENDS),$(firstword $(unpack $(D))))

 

Feature: $(callwords function, words) function

 

            By example:

                        $(callwords function,a b c) => $(call function,a,b,c)

            Useful for:

           

            DEPENDS += $(pack module-name module-dir)

           

            define define_target

            target_$(1):

                        @echo Building $(1)

                        @$$(MAKE) -C $(2)

           

            endef

           

            $(for D,$(DEPENDS),$(eval $(callwords define_target,$(unpack $(D)))))

 

Base version for changes is 3.81.

 

Regards,

Rafi Einstein

 

Attachment: features.zip
Description: features.zip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]