|
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 Messaging and Web Security http://www.symantec.com/ ----------------------------------------------------- Mobile: (415) 846-1370 address@hidden From:
address@hidden
[mailto:address@hidden On Behalf Of Palani
Chinnakannan (pals) Hello,
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 directory.
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 \
../include/clos_api_services.h EXPORT_LIB_PATH
:= EXPORT_LIBS
:= EXPORTED_HDRS
:= $(addprefix
$(EXPORT_HDR_PATH)/,$(notdir $(EXPORT_HDRS))) $(EXPORTED_HDRS): $(EXPORT_HDRS)
@echo "updating header: $? ";
cp $? $(EXPORT_HDR_PATH) install: $(EXPORTED_HDRS) all: install clean:
rm -f $(ARCH)/* distclean: clean
rm -f $(EXPORT_HDR_PATH)/*.h |
[Prev in Thread] | Current Thread | [Next in Thread] |