Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / ktap / test / ffi / Makefile
1 obj-m += ktap_ffi_test.o
2
3 all: funct_mod cparser_test
4
5 funct_mod:
6         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
7
8 INC=../../include
9 U_DIR=../../userspace
10 RUNTIME=../../runtime
11 U_FFI_DIR=$(U_DIR)/ffi
12 CPARSER_FILES=cparser.o ctype.o ffi_type.o
13 KTAPC_CFLAGS = -Wall -O2
14
15 cparser.o: $(U_FFI_DIR)/cparser.c $(INC)/*
16         $(QUIET_CC)$(CC) -DCONFIG_KTAP_FFI -o $@ -c $<
17
18 ctype.o: $(U_FFI_DIR)/ctype.c $(INC)/*
19         $(QUIET_CC)$(CC) -DCONFIG_KTAP_FFI -o $@ -c $<
20
21 ffi_type.o: $(RUNTIME)/ffi/ffi_type.c $(INC)/*
22         $(QUIET_CC)$(CC) -DCONFIG_KTAP_FFI -o $@ -c $<
23
24 cparser_test: cparser_test.c $(CPARSER_FILES) $(INC)/*
25         $(QUIET_CC)$(CC) -DCONFIG_KTAP_FFI -I$(INC) -I$(U_DIR) $(KTAPC_CFLAGS) \
26                 -o $@ $< $(CPARSER_FILES)
27
28 load:
29         insmod ktap_ffi_test.ko
30
31 unload:
32         rmmod ktap_ffi_test
33
34 test: all
35         @echo "testing cparser:"
36         ./cparser_test
37         @echo "testing ffi module:"
38         rmmod ktap_ffi_test > /dev/null 2>&1 || true
39         insmod ktap_ffi_test.ko
40         ../../ktap ffi_test.kp
41         rmmod ktap_ffi_test.ko
42         @echo "[*] all ffi tests passed."
43
44 clean:
45         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
46         rm -rf cparser_test