Tweaked the debug building and printing a little - I hope this works OK for everyone. Let me know if not.
Tamped down a few warnings. For the demo/server Makefile, made an either/or choice between executable size optimization (normal) or gdb debug info and no optimization.
This commit is contained in:
@@ -37,19 +37,27 @@ LIBRARY1=-L$(BACNET_LIB_DIR),-l$(BACNET_LIB_NAME)
|
||||
LIBRARY2=-lws2_32,-lgcc,-lm,-liphlpapi,-lwinmm
|
||||
LIBRARIES=$(LIBRARY1),$(LIBRARY2)
|
||||
endif
|
||||
|
||||
#build for release (default) or debug
|
||||
DEBUGGING =
|
||||
OPTIMIZATION = -Os
|
||||
ifeq (${BUILD},debug)
|
||||
# Use -g to put info for gdb in the executable
|
||||
DEBUGGING = -g -DDEBUG_ENABLED=1
|
||||
OPTIMIZATION = -O0
|
||||
DEBUGGING = -g
|
||||
LINK_OPTIMIZATION =
|
||||
ifeq (${BACDL_DEFINE},-DBACDL_BIP=1)
|
||||
DEFINES += -DBIP_DEBUG
|
||||
endif
|
||||
else
|
||||
DEBUGGING =
|
||||
# Use -f optimizations and then link option --gc-sections to reduce executable size.
|
||||
# Of course, not when you want debug output for gdb!
|
||||
OPTIMIZATION = -Os -fdata-sections -ffunction-sections
|
||||
LINK_OPTIMIZATION = -Wl,--gc-sections
|
||||
endif
|
||||
|
||||
# put all the flags together
|
||||
CFLAGS = -Wall $(DEBUGGING) $(OPTIMIZATION) $(INCLUDES) $(DEFINES) -fdata-sections -ffunction-sections
|
||||
LFLAGS = -Wl,-Map=$(TARGET).map,$(LIBRARIES),--gc-sections
|
||||
CFLAGS = -Wall $(DEBUGGING) $(OPTIMIZATION) $(INCLUDES) $(DEFINES)
|
||||
LFLAGS = -Wl,-Map=$(TARGET).map,$(LIBRARIES) $(LINK_OPTIMIZATION)
|
||||
|
||||
SRCS = main.c
|
||||
|
||||
|
||||
Reference in New Issue
Block a user