Suppose I hava a make file like this. I can get normal build through make and get a debug build through make debug. But how to write a target so that I can get both normal build and debug build in one command like make both?
DST := /data/result
debug: CFLAGS += -DDEBUG -g
debug: DST = /some/dir
target: src1.c src2.c
gcc -bla -bla -o target
cp target $(DST)
debug: target
My final solution is as follows:
DST := /data/result
debug: CFLAGS += -DDEBUG -g
debug: DST = /some/dir
target: src1.c src2.c
gcc -bla -bla -o target
cp target $(DST)
debug: target
both:
make debug && make clean && make all
1 Answer