Re: unusual makefiles - problems with rules



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

.



Relevant Pages

  • unusual makefiles - problems with rules
    ... I'm trying to compile my C++ code in such a way, ... files directly to specified folder. ... Nothing to be done for 'lib' ... # compile help modules used in .so and main server classes ...
    (comp.os.linux.development.apps)
  • Re: unusual makefiles - problems with rules
    ... I'm trying to compile my C++ code in such a way, ... files directly to specified folder. ... Nothing to be done for 'lib' ... # compile help modules used in .so and main server classes ...
    (comp.programming)
  • unusual makefiles - problems with rules
    ... I'm trying to compile my C++ code in such a way, ... files directly to specified folder. ... Nothing to be done for 'lib' ... # compile help modules used in .so and main server classes ...
    (comp.programming)
  • Re: Getting started on the HP49g+
    ... either the original HP extable lib ... extable2 lib from http://www.hpcalc.org/details.php?id=3940. ... ask again if you have any problem installing libraries. ... compile the string with ASM (listed in the development lib menu, ...
    (comp.sys.hp48)
  • Re: Help on coredll.dll
    ... I have compiled the code using eVC 3.0 and have no problem, ... So I guess I need an extra lib for SIP support in cVC 4.0. ... I use standard SDK and try to compile for ARM device. ...
    (microsoft.public.windowsce.app.development)