[Top][All Lists]

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

RE: Creating a header file dependency.

From: Samuel Klatchko
Subject: RE: Creating a header file dependency.
Date: Tue, 1 Jun 2010 10:14:20 -0700

You can easily do this with a wildcard rule:


 dest/%: src/%

                @echo Updating $(<F)

                cp $< $@


all: dest/a dest/b dest/c dest/d



R Samuel Klatchko
Software Architect
Symantec Corporation

Messaging and Web Security


Office: (415) 738-2663

Mobile: (415) 846-1370



From: address@hidden [mailto:address@hidden On Behalf Of Palani Chinnakannan (pals)
Sent: Sunday, May 30, 2010 10:02 PM
To: address@hidden
Subject: Creating a header file dependency.



                We are used to this concept of staging a set of header files from

our components during build.  So, each sub-system/component specifies

a list of header files that needs to be staged. They also specify a staging



                Now, I am creating a dependency between the original header

and the staged header so that the staging takes place only when the

original header changes. (Otherwise, a blind copy breaks the

dependency and leads to unnecessary rebuilds.


       So, when I do this based on the following, I expect only the changed

file to be staged. However, looks like every file gets staged from a component

even though only one file is staged.


Here is my Makefile. When I do make all it  exports all file even if only

one file is changed.


# Default target must appear before any include lines

.PHONY: all



# Customizations for this local Makefile


EXPORT_HDR_PATH       := $(CLUSTER_OS_ROOT)/BUILD/inc/common/clos_sdk


EXPORT_HDRS                  := \

                                                                ../include/clos_api_socket_funcs.h \

                                                                ../include/clos_api_cerrno.h \



EXPORT_LIB_PATH          :=

EXPORT_LIBS                     :=


EXPORTED_HDRS             := $(addprefix $(EXPORT_HDR_PATH)/,$(notdir $(EXPORT_HDRS)))



                @echo "updating header: $? ";

                cp $? $(EXPORT_HDR_PATH)


install: $(EXPORTED_HDRS)


all: install



                rm -f $(ARCH)/*


distclean: clean

                rm -f $(EXPORT_HDR_PATH)/*.h

reply via email to

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