Skip to content

Commit

Permalink
Merge pull request #11 from pearsonk/segregate-debug
Browse files Browse the repository at this point in the history
Segregate compiler debug flag from build
  • Loading branch information
todbot authored Dec 9, 2018
2 parents 3ffd04a + efd0038 commit 0b74330
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,21 @@ endif

#CFLAGS += -O -Wall -std=gnu99 -I ../hardware/firmware
CFLAGS += -std=gnu99
CFLAGS += -g
CFLAGS += -DBLINK1_VERSION=\"$(BLINK1_VERSION)\"

OBJS += blink1-lib.o


PKGOS = $(BLINK1_VERSION)

.PHONY: all install help blink1control-tool
.PHONY: all install help blink1control-tool debug

#all: msg blink1-tool blink1-server-simple
all: msg prep blink1-tool lib

debug: CFLAGS += -DDEBUG -g
debug: all

# symbolic targets:
help:
@echo "This Makefile works on multiple archs. Use one of the following:"
Expand Down Expand Up @@ -517,13 +519,13 @@ $(OBJS): %.o: %.c

blink1-tool: $(OBJS) blink1-tool.o
$(CC) $(CFLAGS) -c blink1-tool.c -o blink1-tool.o
$(CC) $(CFLAGS) $(EXEFLAGS) -g $(OBJS) $(LIBS) blink1-tool.o -o blink1-tool$(EXE) $(LDFLAGS)
$(CC) $(CFLAGS) $(EXEFLAGS) $(OBJS) $(LIBS) blink1-tool.o -o blink1-tool$(EXE) $(LDFLAGS)

blink1-tiny-server: $(OBJS) server/blink1-tiny-server.c
# $(CC) $(CFLAGS) -DMG_ENABLE_THREADS -I. -I./server/mongoose -c server/blink1-tiny-server.c -o blink1-tiny-server.o
$(CC) $(CFLAGS) -DMG_ENABLE_THREADS -I. -I./server/mongoose -c server/blink1-tiny-server.c -o blink1-tiny-server.o
$(CC) $(CFLAGS) -DMG_ENABLE_THREADS -I. -I./server/mongoose -c ./server/mongoose/mongoose.c -o ./server/mongoose/mongoose.o
$(CC) -g $(OBJS) $(EXEFLAGS) ./server/mongoose/mongoose.o $(LIBS) -lpthread blink1-tiny-server.o -o blink1-tiny-server$(EXE) $(LDFLAGS)
$(CC) $(OBJS) $(EXEFLAGS) ./server/mongoose/mongoose.o $(LIBS) -lpthread blink1-tiny-server.o -o blink1-tiny-server$(EXE) $(LDFLAGS)

$(LIBTARGET): $(OBJS)
$(CC) $(LIBFLAGS) $(CFLAGS) $(OBJS) $(LIBS)
Expand Down

0 comments on commit 0b74330

Please sign in to comment.