In C, how to disable optimization in the makefile? -
i have following makefile structure
# default optimization level o ?= 2 tests = $(patsubst %.c,%,$(sort $(wildcard test[0-9][0-9][0-9].c))) all: $(tests) hhtest -include build/rules.mk libs = -lm %.o: %.c $(buildstamp) $(call run,$(cc) $(cppflags) $(cflags) -o$(o) $(depcflags) -o $@ -c,compile,$<) test%: test%.o m61.o $(call run,$(cc) $(cflags) -o $@ $^ $(ldflags) $(libs),link $@) hhtest: hhtest.o m61.o $(call run,$(cc) $(cflags) -o $@ $^ $(ldflags) $(libs),link $@)
and when debugging have <optimized out>
value:
print ptr <optimized out>
how disable issue?
your code seems structured in such way (i.e. pass -o$(o)
cc) should able say:
o ?= 0
instead of o ?= 2
.
Comments
Post a Comment