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
http://www.symantec.com/
-----------------------------------------------------
Office: (415) 738-2663
Mobile: (415) 846-1370
[email protected]
From: [email protected]
[mailto:[email protected]] On Behalf
Of Palani Chinnakannan (pals)
Sent: Sunday, May 30, 2010 10:02 PM
To: [email protected]
Subject: Creating a header file dependency.
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
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make