blob: eceac38f3c65b018647530196a9040f61131a643 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# Makefile for the linux kernel.
3#
4
Peter Zijlstra029632f2011-10-25 10:00:11 +02005obj-y = fork.o exec_domain.o panic.o printk.o \
Max Krasnyansky68f4f1e2008-05-29 11:17:02 -07006 cpu.o exit.o itimer.o time.o softirq.o resource.o \
Eric W. Biedermanafa588b2009-04-02 23:44:59 -07007 sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \
Oleg Nesterove73f8952012-05-11 10:59:07 +10008 signal.o sys.o kmod.o workqueue.o pid.o task_work.o \
Paul E. McKenneye260be62008-01-25 21:08:24 +01009 rcupdate.o extable.o params.o posix-timers.o \
Thomas Gleixnerc0a31322006-01-09 20:52:32 -080010 kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
Matthew Wilcox64ac24e2008-03-07 21:55:58 -050011 hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
Peter Zijlstra391e43d2011-11-15 17:14:39 +010012 notifier.o ksysfs.o cred.o \
Paul E. McKenney3180d892012-07-12 01:55:54 -070013 async.o range.o groups.o lglock.o smpboot.o
Peter Zijlstra029632f2011-10-25 10:00:11 +020014
Steven Rostedt606576c2008-10-06 19:06:12 -040015ifdef CONFIG_FUNCTION_TRACER
Steven Rostedt6ec56232008-05-14 21:30:30 -040016# Do not trace debug files and internal ftrace files
17CFLAGS_REMOVE_lockdep.o = -pg
18CFLAGS_REMOVE_lockdep_proc.o = -pg
19CFLAGS_REMOVE_mutex-debug.o = -pg
20CFLAGS_REMOVE_rtmutex-debug.o = -pg
21CFLAGS_REMOVE_cgroup-debug.o = -pg
Peter Zijlstrae360adb2010-10-14 14:01:34 +080022CFLAGS_REMOVE_irq_work.o = -pg
Steven Rostedt1d09daa2008-05-12 21:20:55 +020023endif
24
Peter Zijlstra391e43d2011-11-15 17:14:39 +010025obj-y += sched/
Rafael J. Wysockidae5cbc2012-01-14 00:33:03 +010026obj-y += power/
Peter Zijlstra391e43d2011-11-15 17:14:39 +010027
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -070028ifeq ($(CONFIG_CHECKPOINT_RESTORE),y)
29obj-$(CONFIG_X86) += kcmp.o
30endif
Matt Helsley8174f152008-10-18 20:27:19 -070031obj-$(CONFIG_FREEZER) += freezer.o
Adrian Bunkb03f6482008-07-25 01:45:35 -070032obj-$(CONFIG_PROFILING) += profile.o
Ingo Molnar8637c092006-07-03 00:24:38 -070033obj-$(CONFIG_STACKTRACE) += stacktrace.o
john stultzad596172006-06-26 00:25:06 -070034obj-y += time/
Ingo Molnar408894e2006-01-09 15:59:20 -080035obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
Ingo Molnarfbb9ce952006-07-03 00:24:50 -070036obj-$(CONFIG_LOCKDEP) += lockdep.o
Ingo Molnara8f24a32006-07-03 00:24:52 -070037ifeq ($(CONFIG_PROC_FS),y)
38obj-$(CONFIG_LOCKDEP) += lockdep_proc.o
39endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070040obj-$(CONFIG_FUTEX) += futex.o
Ingo Molnar34f192c2006-03-27 01:16:24 -080041ifeq ($(CONFIG_COMPAT),y)
42obj-$(CONFIG_FUTEX) += futex_compat.o
43endif
Ingo Molnar23f78d4a2006-06-27 02:54:53 -070044obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
Ingo Molnare7eebaf2006-06-27 02:54:55 -070045obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
Thomas Gleixner61a87122006-06-27 02:54:56 -070046obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070047obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
Amerigo Wang351f8f82011-01-12 16:59:39 -080048obj-$(CONFIG_SMP) += smp.o
Andrew Morton9316fca2009-01-14 09:35:44 -080049ifneq ($(CONFIG_SMP),y)
Andrew Morton53ce3d92009-01-09 12:27:08 -080050obj-y += up.o
51endif
Max Krasnyansky68f4f1e2008-05-29 11:17:02 -070052obj-$(CONFIG_SMP) += spinlock.o
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070053obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
Ingo Molnar8a25d5d2006-07-03 00:24:54 -070054obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070055obj-$(CONFIG_UID16) += uid16.o
56obj-$(CONFIG_MODULES) += module.o
Takashi Iwai919aa452012-12-11 11:37:13 +103057obj-$(CONFIG_MODULE_SIG) += module_signing.o modsign_pubkey.o modsign_certificate.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070058obj-$(CONFIG_KALLSYMS) += kallsyms.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070059obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
Eric W. Biedermandc009d92005-06-25 14:57:52 -070060obj-$(CONFIG_KEXEC) += kexec.o
Arjan van de Ven6dab2772008-01-30 13:33:08 +010061obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070062obj-$(CONFIG_COMPAT) += compat.o
Paul Menageddbcc7e2007-10-18 23:39:30 -070063obj-$(CONFIG_CGROUPS) += cgroup.o
Matt Helsleydc52ddc2008-10-18 20:27:21 -070064obj-$(CONFIG_CGROUP_FREEZER) += cgroup_freezer.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070065obj-$(CONFIG_CPUSETS) += cpuset.o
Pavel Emelyanovaee16ce2008-02-08 04:18:23 -080066obj-$(CONFIG_UTS_NS) += utsname.o
67obj-$(CONFIG_USER_NS) += user_namespace.o
Pavel Emelyanov74bd59b2008-02-08 04:18:24 -080068obj-$(CONFIG_PID_NS) += pid_namespace.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070069obj-$(CONFIG_IKCONFIG) += configs.o
Pavel Emelianove552b662008-02-07 00:13:49 -080070obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
Tejun Heobbf1bb32010-05-08 16:20:53 +020071obj-$(CONFIG_SMP) += stop_machine.o
Ananth N Mavinakayanahalli8c1c9352008-01-30 13:32:53 +010072obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
Eric Paris939a67f2009-12-17 20:12:06 -050073obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070074obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
Eric Paris939a67f2009-12-17 20:12:06 -050075obj-$(CONFIG_AUDIT_WATCH) += audit_watch.o
Al Viro74c3cbe2007-07-22 08:04:18 -040076obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
Eric Paris939a67f2009-12-17 20:12:06 -050077obj-$(CONFIG_GCOV_KERNEL) += gcov/
Linus Torvalds1da177e2005-04-16 15:20:36 -070078obj-$(CONFIG_KPROBES) += kprobes.o
Jason Wesselc4338202009-05-19 07:49:32 -050079obj-$(CONFIG_KGDB) += debug/
Mandeep Singh Bainese162b392009-01-15 11:08:40 -080080obj-$(CONFIG_DETECT_HUNG_TASK) += hung_task.o
Don Zickus58687ac2010-05-07 17:11:44 -040081obj-$(CONFIG_LOCKUP_DETECTOR) += watchdog.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070082obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
83obj-$(CONFIG_SECCOMP) += seccomp.o
Paul E. McKenneya241ec62005-10-30 15:03:12 -080084obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010085obj-$(CONFIG_TREE_RCU) += rcutree.o
Paul E. McKenneyf41d9112009-08-22 13:56:52 -070086obj-$(CONFIG_TREE_PREEMPT_RCU) += rcutree.o
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010087obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o
Paul E. McKenney9b1d82f2009-10-25 19:03:50 -070088obj-$(CONFIG_TINY_RCU) += rcutiny.o
Paul E. McKenneya57eb942010-06-29 16:49:16 -070089obj-$(CONFIG_TINY_PREEMPT_RCU) += rcutiny.o
Jens Axboeb86ff9812006-03-23 19:56:55 +010090obj-$(CONFIG_RELAY) += relay.o
Eric W. Biederman39732ac2007-02-14 00:33:58 -080091obj-$(CONFIG_SYSCTL) += utsname_sysctl.o
Shailabh Nagarca74e922006-07-14 00:24:36 -070092obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
Jay Lanf3cef7a2006-09-30 23:28:55 -070093obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
Mathieu Desnoyers97e1c182008-07-18 12:16:16 -040094obj-$(CONFIG_TRACEPOINTS) += tracepoint.o
Arjan van de Ven97455122008-01-25 21:08:34 +010095obj-$(CONFIG_LATENCYTOP) += latencytop.o
Daisuke HATAYAMA1fcccba2010-03-05 13:44:07 -080096obj-$(CONFIG_BINFMT_ELF) += elfcore.o
97obj-$(CONFIG_COMPAT_BINFMT_ELF) += elfcore.o
98obj-$(CONFIG_BINFMT_ELF_FDPIC) += elfcore.o
Steven Rostedt606576c2008-10-06 19:06:12 -040099obj-$(CONFIG_FUNCTION_TRACER) += trace/
Steven Rostedtbc0c38d2008-05-12 21:20:42 +0200100obj-$(CONFIG_TRACING) += trace/
Josh Triplettea632e92012-09-02 19:45:14 -0700101obj-$(CONFIG_TRACE_CLOCK) += trace/
Paul Mundt1155de42009-06-25 14:30:12 +0900102obj-$(CONFIG_RING_BUFFER) += trace/
Mathieu Desnoyers870915e2010-10-28 11:31:17 -0400103obj-$(CONFIG_TRACEPOINTS) += trace/
Peter Zijlstrae360adb2010-10-14 14:01:34 +0800104obj-$(CONFIG_IRQ_WORK) += irq_work.o
Colin Crossab100232011-02-10 02:04:45 -0800105obj-$(CONFIG_CPU_PM) += cpu_pm.o
Borislav Petkovfae85b72010-10-26 20:24:03 +0200106
107obj-$(CONFIG_PERF_EVENTS) += events/
108
Avi Kivity7a041092009-10-25 14:24:45 +0200109obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o
Steffen Klassert16295be2010-01-06 19:47:10 +1100110obj-$(CONFIG_PADATA) += padata.o
Olaf Hering93a72052011-03-23 16:43:29 -0700111obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
Jason Baronb77f0f32011-08-05 16:40:40 -0400112obj-$(CONFIG_JUMP_LABEL) += jump_label.o
Frederic Weisbecker91d1aa432012-11-27 19:33:25 +0100113obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115$(obj)/configs.o: $(obj)/config_data.h
116
117# config_data.h contains the same information as ikconfig.h but gzipped.
118# Info from config_data can be extracted from /proc/config*
119targets += config_data.gz
Ben Gardiner41263fc2010-12-14 11:39:44 -0500120$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 $(call if_changed,gzip)
122
Peter Foleye78e8f22011-07-05 19:42:18 -0400123 filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;")
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124targets += config_data.h
125$(obj)/config_data.h: $(obj)/config_data.gz FORCE
Peter Foleye78e8f22011-07-05 19:42:18 -0400126 $(call filechk,ikconfiggz)
H. Peter Anvinbdc80782008-02-08 04:21:26 -0800127
128$(obj)/time.o: $(obj)/timeconst.h
129
130quiet_cmd_timeconst = TIMEC $@
131 cmd_timeconst = $(PERL) $< $(CONFIG_HZ) > $@
132targets += timeconst.h
133$(obj)/timeconst.h: $(src)/timeconst.pl FORCE
134 $(call if_changed,timeconst)
David Howellsd4411082012-09-26 10:09:51 +0100135
136ifeq ($(CONFIG_MODULE_SIG),y)
David Howells631cc662012-09-26 10:09:51 +0100137#
138# Pull the signing certificate and any extra certificates into the kernel
139#
David Howells631cc662012-09-26 10:09:51 +0100140
Michal Mareke10e17742012-12-11 12:26:22 +1030141quiet_cmd_touch = TOUCH $@
142 cmd_touch = touch $@
143
David Howells631cc662012-09-26 10:09:51 +0100144extra_certificates:
Michal Mareke10e17742012-12-11 12:26:22 +1030145 $(call cmd,touch)
David Howells631cc662012-09-26 10:09:51 +0100146
Takashi Iwai919aa452012-12-11 11:37:13 +1030147kernel/modsign_certificate.o: signing_key.x509 extra_certificates
David Howellsd4411082012-09-26 10:09:51 +0100148
149###############################################################################
150#
151# If module signing is requested, say by allyesconfig, but a key has not been
152# supplied, then one will need to be generated to make sure the build does not
153# fail and that the kernel may be used afterwards.
154#
155###############################################################################
Michal Marek22753672013-01-25 13:41:00 +1030156ifndef CONFIG_MODULE_SIG_HASH
David Howells5e8cb1e2012-09-28 11:16:57 +0100157$(error Could not determine digest type to use from kernel config)
158endif
159
David Howellsd4411082012-09-26 10:09:51 +0100160signing_key.priv signing_key.x509: x509.genkey
161 @echo "###"
162 @echo "### Now generating an X.509 key pair to be used for signing modules."
163 @echo "###"
164 @echo "### If this takes a long time, you might wish to run rngd in the"
165 @echo "### background to keep the supply of entropy topped up. It"
H. Peter Anvin20087132012-10-24 14:11:48 -0700166 @echo "### needs to be run as root, and uses a hardware random"
167 @echo "### number generator if one is available."
David Howellsd4411082012-09-26 10:09:51 +0100168 @echo "###"
Michal Marek22753672013-01-25 13:41:00 +1030169 openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
170 -batch -x509 -config x509.genkey \
David Howellsd4411082012-09-26 10:09:51 +0100171 -outform DER -out signing_key.x509 \
172 -keyout signing_key.priv
173 @echo "###"
174 @echo "### Key pair generated."
175 @echo "###"
176
177x509.genkey:
178 @echo Generating X.509 key generation config
179 @echo >x509.genkey "[ req ]"
180 @echo >>x509.genkey "default_bits = 4096"
181 @echo >>x509.genkey "distinguished_name = req_distinguished_name"
182 @echo >>x509.genkey "prompt = no"
David Howellse7d113b2012-09-28 11:16:57 +0100183 @echo >>x509.genkey "string_mask = utf8only"
David Howellsd4411082012-09-26 10:09:51 +0100184 @echo >>x509.genkey "x509_extensions = myexts"
185 @echo >>x509.genkey
186 @echo >>x509.genkey "[ req_distinguished_name ]"
187 @echo >>x509.genkey "O = Magrathea"
188 @echo >>x509.genkey "CN = Glacier signing key"
189 @echo >>x509.genkey "emailAddress = slartibartfast@magrathea.h2g2"
190 @echo >>x509.genkey
191 @echo >>x509.genkey "[ myexts ]"
192 @echo >>x509.genkey "basicConstraints=critical,CA:FALSE"
193 @echo >>x509.genkey "keyUsage=digitalSignature"
194 @echo >>x509.genkey "subjectKeyIdentifier=hash"
195 @echo >>x509.genkey "authorityKeyIdentifier=keyid"
196endif