2015-01-03 15:34:32 +00:00
|
|
|
FIRMWARE=../..
|
|
|
|
|
|
|
|
CC ?= gcc
|
2015-01-03 16:06:21 +00:00
|
|
|
# Note: Don't be fooled by MEMORYSIZE here
|
|
|
|
# We have a fixed, predictable buffer in UT_core_allocator_init()
|
|
|
|
CFLAGS += -g -O2 -DDEBUG -D__PCTOOL__ -DBUFLIB_UNIT_TEST -DMEMORYSIZE=8 -DBUFLIB_DEBUG_BLOCKS -std=gnu99 -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I.
|
2015-01-03 15:34:32 +00:00
|
|
|
LDFLAGS += -L. -lpthread
|
|
|
|
|
|
|
|
.PHONY: clean all
|
|
|
|
|
2015-01-03 16:06:21 +00:00
|
|
|
TARGETS_OBJ = test_main.o \
|
2015-01-03 16:36:37 +00:00
|
|
|
test_main2.o \
|
|
|
|
test_move.o \
|
|
|
|
test_move2.o
|
2015-01-03 16:06:21 +00:00
|
|
|
|
2015-01-03 15:34:32 +00:00
|
|
|
TARGETS = $(TARGETS_OBJ:.o=)
|
|
|
|
|
|
|
|
LIB_OBJ = buflib.o \
|
2015-01-03 16:06:21 +00:00
|
|
|
core_alloc.o \
|
2015-01-03 15:34:32 +00:00
|
|
|
crc32.o \
|
2015-01-03 15:47:27 +00:00
|
|
|
strlcpy.o \
|
|
|
|
util.o
|
|
|
|
|
2015-01-03 15:34:32 +00:00
|
|
|
LIB_FILE = libbuflib.a
|
|
|
|
LIB = buflib
|
|
|
|
|
|
|
|
|
|
|
|
ifndef V
|
|
|
|
SILENT:=@
|
|
|
|
else
|
|
|
|
VERBOSEOPT:=-v
|
|
|
|
endif
|
|
|
|
|
|
|
|
PRINTS=$(SILENT)$(call info,$(1))
|
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
|
|
|
test_%: test_%.o $(LIB_FILE)
|
|
|
|
$(call PRINTS,LD $@)$(CC) $(LDFLAGS) -o $@ $< -l$(LIB)
|
|
|
|
|
|
|
|
$(TARGETS): $(TARGETS_OBJ) $(LIB_FILE)
|
|
|
|
|
|
|
|
buflib.o: $(FIRMWARE)/buflib.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2015-01-03 16:06:21 +00:00
|
|
|
core_alloc.o: $(FIRMWARE)/core_alloc.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2015-01-03 15:34:32 +00:00
|
|
|
crc32.o: $(FIRMWARE)/common/crc32.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
strlcpy.o: $(FIRMWARE)/common/strlcpy.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(call PRINTS,CC $<)$(CC) $(CFLAGS) -c $<
|
|
|
|
|
|
|
|
$(LIB_FILE): $(LIB_OBJ)
|
|
|
|
$(call PRINTS,AR $@)ar rcs $@ $^
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm *.o $(TARGETS) $(LIB_FILE)
|