Add optional -DDEBUG to Makefile.

pull/1/head
Peter Zotov 2011-02-15 19:48:36 +03:00
rodzic ca668a5a5f
commit fc7b68944d
2 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
PRG := st-util
DEBUG := #-DDEBUG
all: $(PRG)
@ -13,7 +14,7 @@ $(PRG): $(OBJS)
%.o: ../src/%.c
gcc -O3 -g3 -Wall -Werror -c -std=gnu99 -MMD -MP \
-fno-strict-aliasing -Wno-unused \
-fno-strict-aliasing -Wno-unused $(DEBUG) \
-MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"\
-o "$@" "$<"

Wyświetl plik

@ -95,7 +95,9 @@ int serve(struct stlink* sl, int port) {
return 1;
}
//printf("recv: %s\n", packet);
#ifdef DEBUG
printf("recv: %s\n", packet);
#endif
char* reply = NULL;
@ -246,7 +248,9 @@ int serve(struct stlink* sl, int port) {
}
if(reply) {
//printf("send: %s\n", reply);
#ifdef DEBUG
printf("send: %s\n", reply);
#endif
int result = gdb_send_packet(client, reply);
if(result != 0) {