Re: unusual makefiles - problems with rules
- From: toby <toby@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 06:32:51 -0700
On Jul 30, 1:58 pm, Zbigniew <z...@xxxxxxxxx> wrote:
Hi,
I'm trying to compile my C++ code in such a way, that I get all .o
files directly to specified folder.
I want to avoid creation of .o files in current dir and then copy them
over to desired one.
Could someone please tell me, why the follwoing makefile does nothing?
make says: Nothing to be done for 'lib'
I do not have any .o files created...
Try this:
######
CPPFLAGS = -I$(INC)
INC = ../Include
OUTL = ../output/Libs
MODULES = $(OUTL)/AmaSocket.o $(OUTL)/DbgLIB.o
lib : $(OUTL)/liasut.a
$(OUTL)/liasut.a : $(MODULES)
$(AR) -r $@ $^
$(OUTL)/DbgLIB.o : $(INC)/DbgLIB.h $(INC)/Dbg.h
$(OUTL)/%.o : %.cpp
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CDEFS)
clean:
rm -f $(MODULES) $(OUTL)/liasut.a
##### END
Assuming this directory structure:
$ ls -lR
drwxr-xr-x 4 toby toby 136 Jul 31 10:29 Include
drwxr-xr-x 3 toby toby 102 Jul 31 10:28 output
drwxr-xr-x 5 toby toby 170 Jul 31 10:30 src
../Include:
-rw-r--r-- 1 toby toby 0 Jul 31 10:29 Dbg.h
-rw-r--r-- 1 toby toby 0 Jul 31 10:29 DbgLIB.h
../output:
drwxr-xr-x 5 toby toby 170 Jul 31 10:30 Libs
../output/Libs:
-rw-r--r-- 1 toby toby 356 Jul 31 10:30 AmaSocket.o
-rw-r--r-- 1 toby toby 356 Jul 31 10:30 DbgLIB.o
-rw-r--r-- 1 toby toby 840 Jul 31 10:30 liasut.a
../src:
-rw-r--r-- 1 toby toby 0 Jul 31 10:28 AmaSocket.cpp
-rw-r--r-- 1 toby toby 0 Jul 31 10:28 DbgLIB.cpp
-rw-r--r-- 1 toby toby 332 Jul 31 10:30 Makefile
.
- References:
- unusual makefiles - problems with rules
- From: Zbigniew
- unusual makefiles - problems with rules
- Prev by Date: Re: unusual makefiles - problems with rules
- Next by Date: Re: Choosing a PL - What you can do or how you do it?
- Previous by thread: Re: unusual makefiles - problems with rules
- Next by thread: Xlib and image from file (e.g. .bmp, .jpeg etc.)
- Index(es):
Relevant Pages
|