summaryrefslogtreecommitdiff
path: root/tests/fs-tests/integrity/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fs-tests/integrity/Makefile')
-rw-r--r--tests/fs-tests/integrity/Makefile18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/fs-tests/integrity/Makefile b/tests/fs-tests/integrity/Makefile
index 2cdd470..509a94e 100644
--- a/tests/fs-tests/integrity/Makefile
+++ b/tests/fs-tests/integrity/Makefile
@@ -4,8 +4,11 @@ CC = gcc
endif
COMMON_HEADERS_DIR := ../../../include
+LIBUBI_PATH=../../../ubi-utils/
+LIBUBI_SRC_PATH=../../../ubi-utils/src/
+LIBUBI_HEADER_PATH=../../../ubi-utils/include
-CFLAGS := $(CFLAGS) -Wall -g -O2 -I$(COMMON_HEADERS_DIR)
+CFLAGS := $(CFLAGS) -Wall -g -O2 -I$(COMMON_HEADERS_DIR) -I$(LIBUBI_HEADER_PATH)
LDFLAGS := $(LDFLAGS)
@@ -13,10 +16,17 @@ TARGETS = integck
all: $(TARGETS)
+# Compile ubilib
+libubi.a:
+ $(CC) $(CFLAGS) -I $(LIBUBI_SRC_PATH) -c $(LIBUBI_SRC_PATH)/libubi.c -o libubi.o
+ ar cr libubi.a libubi.o
+
+$(TARGETS): libubi.a
+
# Disable optimizations to make it possible to use gdb comfortably
# Use -rdynamic to have stack backtraces
-debug:
- gcc $(CFLAGS) -O0 -D INTEGCK_DEBUG -rdynamic integck.c -o integck
+debug: libubi.a
+ gcc $(CFLAGS) -O0 -D INTEGCK_DEBUG -rdynamic integck.c libubi.a -o integck
clean:
- rm -f *.o $(TARGETS)
+ rm -f *.o $(TARGETS) libubi.a