Lines Matching +full:gen +full:- +full:2
1 # SPDX-License-Identifier: GPL-2.0
3 uname_M := $(shell uname -m 2>/dev/null || echo not)
4 MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
6 # Without this, failed build products remain, with up-to-date timestamps,
11 # Avoid accidental wrong builds, due to built-in rules working just a little
12 # bit too well--but not quite as well as required for our situation here.
16 # However, the built-in rules, if not suppressed, will pick up CFLAGS and the
17 # initial LDLIBS (but not the target-specific LDLIBS, because those are only
21 MAKEFLAGS += --no-builtin-rules
23 CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
24 LDLIBS = -lrt
27 TEST_GEN_FILES += hmm-tests
28 TEST_GEN_FILES += hugepage-mmap
29 TEST_GEN_FILES += hugepage-shm
33 TEST_GEN_FILES += mlock-random-test
34 TEST_GEN_FILES += mlock2-tests
36 TEST_GEN_FILES += on-fault-limit
37 TEST_GEN_FILES += thuge-gen
38 TEST_GEN_FILES += transhuge-stress
43 CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_32bit_program.c -m32)
45 CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_program.c -no-pie)
52 CFLAGS += -no-pie
83 $(OUTPUT)/hmm-tests: LDLIBS += -lhugetlbfs -lpthread
89 define gen-target-rule-32
94 define gen-target-rule-64
100 $(BINARIES_32): CFLAGS += -m32
101 $(BINARIES_32): LDLIBS += -lrt -ldl -lm
103 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
104 $(foreach t,$(TARGETS),$(eval $(call gen-target-rule-32,$(t))))
108 $(BINARIES_64): CFLAGS += -m64
109 $(BINARIES_64): LDLIBS += -lrt -ldl
111 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
112 $(foreach t,$(TARGETS),$(eval $(call gen-target-rule-64,$(t))))
115 # x86_64 users should be encouraged to install 32-bit libraries
120 @echo "Warning: you seem to have a broken 32-bit build" 2>&1; \
121 echo "environment. This will reduce test coverage of 64-bit" 2>&1; \
122 echo "kernels. If you are using a Debian-like distribution," 2>&1; \
123 echo "try:"; 2>&1; \
125 echo " apt-get install gcc-multilib libc6-i386 libc6-dev-i386"; \
127 echo "If you are using a Fedora-like distribution, try:"; \
129 echo " yum install glibc-devel.*i686"; \
134 $(OUTPUT)/userfaultfd: LDLIBS += -lpthread
136 $(OUTPUT)/mlock-random-test: LDLIBS += -lcap