GNU Make implicit rules
- From: root <root@xxxxxxxxx>
- Date: Sun, 26 Mar 2006 17:56:12 GMT
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.
CC = g++
CFLAGS = -O3 -I/usr/include/SDL -I/usr/X11R6/include
CFLAGS_DBG = -O0 -g -I/usr/include/SDL -I/usr/X11R6/include
LDFLAGS = -L/usr/X11R6/lib -lSDL -ldl -lm -lX11
OBJECT = main.o dialog.o cfgparser.o sprite.o ai.o actor.o
release: $(OBJECT)
$(CC) -o release.bin $(LDFLAGS) $(OBJECT)
debug: $(OBJECT)
$(CC) -o debug.bin $(LDFLAGS) $(OBJECT)
..cpp.o:
$(CC) -c $(CFLAGS) $<
all: release
.
- Follow-Ups:
- Re: GNU Make implicit rules
- From: Larry I Smith
- Re: GNU Make implicit rules
- From: loic-dev
- Re: GNU Make implicit rules
- Prev by Date: Re: feature tests for pthreads implementation and configuration?
- Next by Date: Re: timer with C
- Previous by thread: Serial interrupt
- Next by thread: Re: GNU Make implicit rules
- Index(es):
Relevant Pages
|