Skip to content

Commit 52dd557

Browse files
EmbeddedAndroidShuah Khan
authored andcommitted
selftest/memfd: enable cross compilation
Use the CC variable instead of hard coding gcc. Also clean up the compiler options by creating a CFLAGS variable. Signed-off-by: Tyler Baker <tyler.baker@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
1 parent 48fd77d commit 52dd557

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎tools/testing/selftests/memfd/Makefile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
CC = $(CROSS_COMPILE)gcc
12
CFLAGS += -D_FILE_OFFSET_BITS=64
23
CFLAGS += -I../../../../include/uapi/
34
CFLAGS += -I../../../../include/
45

56
all:
6-
gcc $(CFLAGS) memfd_test.c -o memfd_test
7+
$(CC) $(CFLAGS) memfd_test.c -o memfd_test
78

89
TEST_PROGS := memfd_test
910

1011
include ../lib.mk
1112

1213
build_fuse:
13-
gcc $(CFLAGS) fuse_mnt.c `pkg-config fuse --cflags --libs` -o fuse_mnt
14-
gcc $(CFLAGS) fuse_test.c -o fuse_test
14+
$(CC) $(CFLAGS) fuse_mnt.c `pkg-config fuse --cflags --libs` -o fuse_mnt
15+
$(CC) $(CFLAGS) fuse_test.c -o fuse_test
1516

1617
run_fuse: build_fuse
1718
@./run_fuse_test.sh || echo "fuse_test: [FAIL]"

0 commit comments

Comments
 (0)