xref: /xnu-11417.121.6/tests/sched/Makefile (revision a1e26a70f38d1d7daa7b49b258e2f8538ad81650)
1*a1e26a70SApple OSS Distributions# Copyright (c) 2024 Apple Inc.  All rights reserved.
2*a1e26a70SApple OSS Distributions
3*a1e26a70SApple OSS DistributionsSCHED_UTILS = sched/sched_test_utils.c
4*a1e26a70SApple OSS DistributionsSCHED_UTILS_FLAGS = -ldarwintest_utils -Wno-format-nonliteral -Wno-cast-qual -Wno-c++98-compat -Wno-format-security
5*a1e26a70SApple OSS DistributionsEXCLUDED_SOURCES += $(SCHED_UTILS)
6*a1e26a70SApple OSS Distributions# Note, SCHED_UTILS depends on -ldarwintest_utils to build
7*a1e26a70SApple OSS Distributions
8*a1e26a70SApple OSS Distributionsinclude sched/sched_test_harness/Makefile
9*a1e26a70SApple OSS Distributions
10*a1e26a70SApple OSS Distributionssched/all_cores_running: OTHER_LDFLAGS += $(SCHED_UTILS_FLAGS)
11*a1e26a70SApple OSS Distributionssched/all_cores_running: $(SCHED_UTILS)
12*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/all_cores_running
13*a1e26a70SApple OSS Distributions
14*a1e26a70SApple OSS Distributions
15*a1e26a70SApple OSS Distributionssched/cluster_bound_threads: OTHER_LDFLAGS += $(SCHED_UTILS_FLAGS)
16*a1e26a70SApple OSS Distributionssched/cluster_bound_threads: $(SCHED_UTILS)
17*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/cluster_bound_threads
18*a1e26a70SApple OSS Distributions
19*a1e26a70SApple OSS Distributionssched/contextswitch: OTHER_LDFLAGS += $(SCHED_UTILS_FLAGS)
20*a1e26a70SApple OSS Distributionssched/contextswitch: $(SCHED_UTILS)
21*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/contextswitch
22*a1e26a70SApple OSS Distributions
23*a1e26a70SApple OSS Distributionssched/enabled_policy: OTHER_LDFLAGS += $(SCHED_UTILS_FLAGS)
24*a1e26a70SApple OSS Distributionssched/enabled_policy: $(SCHED_UTILS)
25*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/enabled_policy
26*a1e26a70SApple OSS Distributions
27*a1e26a70SApple OSS Distributionssched/headers_compat_cpp: OTHER_CXXFLAGS += -I$(SRCROOT)/../osfmk
28*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/headers_compat_cpp
29*a1e26a70SApple OSS Distributions
30*a1e26a70SApple OSS Distributionssched/headers_compat_c: OTHER_CFLAGS += -I$(SRCROOT)/../osfmk
31*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/headers_compat_c
32*a1e26a70SApple OSS Distributions
33*a1e26a70SApple OSS Distributionssched/overloaded_runqueue: CODE_SIGN_ENTITLEMENTS = sched/overloaded_runqueue.entitlements
34*a1e26a70SApple OSS Distributionssched/overloaded_runqueue: OTHER_CFLAGS += -DENTITLED=1
35*a1e26a70SApple OSS Distributionssched/overloaded_runqueue: OTHER_LDFLAGS += -framework ktrace $(SCHED_UTILS_FLAGS)
36*a1e26a70SApple OSS Distributionssched/overloaded_runqueue: $(SCHED_UTILS)
37*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/overloaded_runqueue
38*a1e26a70SApple OSS Distributions
39*a1e26a70SApple OSS Distributionssched/thread_group_fairness: CODE_SIGN_ENTITLEMENTS = sched/thread_group_fairness.entitlements
40*a1e26a70SApple OSS Distributionssched/thread_group_fairness: OTHER_CFLAGS += -DENTITLED=1
41*a1e26a70SApple OSS Distributionssched/thread_group_fairness: OTHER_LDFLAGS += -framework perfdata $(SCHED_UTILS_FLAGS)
42*a1e26a70SApple OSS Distributionssched/thread_group_fairness: $(SCHED_UTILS)
43*a1e26a70SApple OSS Distributionssched/thread_group_fairness: sched/thread_group_fairness_workload_config.h
44*a1e26a70SApple OSS Distributionssched/thread_group_fairness_workload_config.h: sched/thread_group_fairness_workload_config.plist
45*a1e26a70SApple OSS Distributions	xxd -i $< > $@
46*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/thread_group_fairness
47*a1e26a70SApple OSS Distributions
48*a1e26a70SApple OSS Distributionssched/thread_group_flags: CODE_SIGN_ENTITLEMENTS = sched/thread_group_flags.entitlements
49*a1e26a70SApple OSS Distributionssched/thread_group_flags: OTHER_CFLAGS += -DENTITLED=1
50*a1e26a70SApple OSS Distributionssched/thread_group_flags: OTHER_LDFLAGS += -framework ktrace
51*a1e26a70SApple OSS Distributionssched/thread_group_flags: sched/thread_group_flags_workload_config.h
52*a1e26a70SApple OSS Distributionssched/thread_group_flags_workload_config.h: sched/thread_group_flags_workload_config.plist
53*a1e26a70SApple OSS Distributions	xxd -i $< > $@
54*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/thread_group_flags
55*a1e26a70SApple OSS Distributions
56*a1e26a70SApple OSS Distributionssched/yield_aggressor: OTHER_CFLAGS += -Wno-atomic-implicit-seq-cst
57*a1e26a70SApple OSS Distributionssched/yield_aggressor: OTHER_LDFLAGS += -framework perfdata $(SCHED_UTILS_FLAGS)
58*a1e26a70SApple OSS Distributionssched/yield_aggressor: $(SCHED_UTILS)
59*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/yield_aggressor
60*a1e26a70SApple OSS Distributions
61*a1e26a70SApple OSS Distributionssched/zero_to_n_tests: OTHER_LDFLAGS += -framework perfdata $(SCHED_UTILS_FLAGS)
62*a1e26a70SApple OSS DistributionsSCHED_TARGETS += sched/zero_to_n_tests
63*a1e26a70SApple OSS Distributions
64*a1e26a70SApple OSS Distributions# Convenience command for building all of the test targets under sched/
65*a1e26a70SApple OSS Distributions.PHONY: sched/all
66*a1e26a70SApple OSS Distributionssched/all: $(SCHED_TARGETS)
67