help-make
[Top][All Lists]
Advanced

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

Problem with dependency files


From: Mariusz Janczak
Subject: Problem with dependency files
Date: Mon, 10 Oct 2005 10:22:50 +0200

Hello All,
 
First of all I'll describe the source structure... I have a list of modules that have the same look. In root folder there are api source files and within subfolders there are different implementations that realize api functions.
 
./module_a
./module_a/options
./module_a/api_1.c
./module_a/api_1.h
./module_a/impl_a/options
./module_a/impl_a/impl_a.c
./module_a/impl_a/impl_a.h
./module_a/impl_b/options
./module_a/impl_b/impl_b.c
./module_a/impl_b/impl_b.h
 
According to the configuration I select the implementation a or b. Of course I have two different source file lists.
 
To create the dependency files I use the buildin compilator feature and here is a problem. The compilator I use creates the target name using the DOS standard for folder path. The rule:
 
%.$(OBJ_SUFFIX): %.$(C_SUFFIX)
 
creates the following targets:
 
api_1.o: api_1.c
impl_a/impl_a.o: impl_a/impl_a.c
impl_b/impl_b.o: impl_b/impl_b.c
 
and after include the dependency files I receive:
 
api_1.o: api_1.c [dependency file list]
impl_a\impl_a.o: impl_a\impl_a.c [dependency file list]
impl_b\impl_b.o: impl_b\impl_b.c [dependency file list]
 
As You can see those targets don't match.
 
The first solution of this is creation all of the object files within root folder of module (the VPATH is needed):
 
api_1.o: api_1.c [dependency file list]
impl_a.o: impl_a\impl_a.c [dependency file list]
impl_b.o: impl_b\impl_b.c [dependency file list]
 
however the source files placed within subfolders can not have the same file name. It is a problem if I want to create a multi instanece application which uses both of the implementations and the source files have the same file names.
 
Maybe there is another solution that solves that problem.
 
Another problem I have is the question how write the target which depends on options file in the way as follow:
 
api_1.o: api_1.c options
impl_a.o: impl_a/impl_a.c options impl_a/options
impl_b.o: impl_b/impl_b.c options impl_b/options
 
Best Regards,
Mariusz Janczak (address@hidden)
 

reply via email to

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