1# Makefile for vm selftests 2 3ifndef OUTPUT 4 OUTPUT := $(shell pwd) 5endif 6 7CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) 8BINARIES = compaction_test 9BINARIES += hugepage-mmap 10BINARIES += hugepage-shm 11BINARIES += map_hugetlb 12BINARIES += mlock2-tests 13BINARIES += on-fault-limit 14BINARIES += thuge-gen 15BINARIES += transhuge-stress 16BINARIES += userfaultfd 17BINARIES += mlock-random-test 18 19all: $(BINARIES) 20%: %.c 21 $(CC) $(CFLAGS) -o $@ $^ -lrt 22userfaultfd: userfaultfd.c ../../../../usr/include/linux/kernel.h 23 $(CC) $(CFLAGS) -O2 -o $@ $< -lpthread 24 25mlock-random-test: mlock-random-test.c 26 $(CC) $(CFLAGS) -o $@ $< -lcap 27 28../../../../usr/include/linux/kernel.h: 29 make -C ../../../.. headers_install 30 31TEST_PROGS := run_vmtests 32TEST_FILES := $(BINARIES) 33 34include ../lib.mk 35 36clean: 37 $(RM) $(BINARIES) 38