Re: GNU Make implicit rules



Hi root,

I wish to build both debug and release builds of my programs with
a makefile (simplified version below).
I have a problem when using implicit rule though in that I wish to
have separate CFLAGS for both my debug and release builds.
How should I specify implicit rule correctly so that my CFLAGS_DBG
gets picked up when building the debug target?
Any help with this appreciated.

what about:

release: $(OBJECT)
$(CC) $(CFLAGS) -o release.bin $(LDFLAGS) $(OBJECT)

debug: $(OBJECT)
$(CC) $(CFLAGS_DBG) -o debug.bin $(LDFLAGS) $(OBJECT)

Cheers,
Loic.

.



Relevant Pages

  • GNU Make implicit rules
    ... a makefile. ... have separate CFLAGS for both my debug and release builds. ... How should I specify implicit rule correctly so that my CFLAGS_DBG ... gets picked up when building the debug target? ...
    (comp.os.linux.development.apps)
  • Re: Assertions
    ... it doesn't seem to work quite how I expected (i.e. zero runtime overhead in Release build). ... macro actually always expands to NIL when the debug variable is NIL. ... I have not used a Makefile for Common Lisp ...
    (comp.lang.lisp)
  • Makefiel Q: Multiple rules for one target
    ... "All the dependencies mentioned in all the rules are merged into one list of dependencies for the target." ... What I would like to do is have a makefile which builds either a release or debug version of my binary. ... ..PHONY: clean ...
    (comp.os.linux.misc)
  • Re: How to make a library with g95
    ... That makefile looks ok on the surface in isolation (though makefiles are ... I can't debug from such insufficient ... See the prior post for a list of needed data, ... exact command you use to link. ...
    (comp.lang.fortran)
  • How to make different targets with make
    ... I have a Makefile where I simply comment out the commands ... "make debug" builds debug version. ... vpath %.cpp src ...
    (comp.unix.programmer)