aboutsummaryrefslogtreecommitdiff
path: root/tests/fs-tests/integrity/Makefile
blob: 4d6fc7d72472a0eb4d9244252a611c61599c7821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

ifeq ($(origin CC),default)
CC = gcc
endif

COMMON_HEADERS_DIR := ../../../include
LIBUBI_PATH = ../../../ubi-utils/
LIBUBI_HEADER_PATH = $(LIBUBI_PATH)/include

CFLAGS := $(CFLAGS) -Wall -g -O2 -I$(COMMON_HEADERS_DIR) -I$(LIBUBI_HEADER_PATH)

LDFLAGS := $(LDFLAGS)

TARGETS = integck

all: $(TARGETS)

# Compile ubilib
libubi.a:
	$(CC) $(CFLAGS) -c $(LIBUBI_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: libubi.a
	gcc $(CFLAGS) -O0 -D INTEGCK_DEBUG -rdynamic integck.c libubi.a -o integck

clean:
	rm -f *.o $(TARGETS) libubi.a