This stack check implementation leverages the compiler's profiling (gcc -p)
[linux-2.6.git] / arch / um / kernel / Makefile
1
2 # Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 # Licensed under the GPL
4 #
5
6 extra-y := vmlinux.lds.s
7
8 # Descend into ../util for make clean.  This is here because it doesn't work
9 # in arch/um/Makefile.
10
11 subdir- = ../util
12
13 obj-y = checksum.o config.o exec_kern.o exitcode.o filehandle.o frame_kern.o \
14         frame.o helper.o init_task.o irq.o irq_user.o ksyms.o mem.o \
15         mem_user.o physmem.o process.o process_kern.o ptrace.o reboot.o \
16         resource.o sigio_user.o sigio_kern.o signal_kern.o signal_user.o \
17         smp.o syscall_kern.o syscall_user.o sysrq.o sys_call_table.o \
18         tempfile.o time.o time_kern.o tlb.o trap_kern.o trap_user.o \
19         uaccess_user.o um_arch.o umid.o user_util.o
20
21 obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o
22 obj-$(CONFIG_GPROF)     += gprof_syms.o
23 obj-$(CONFIG_GCOV)      += gmon_syms.o
24 obj-$(CONFIG_TTY_LOG)   += tty_log.o
25
26 obj-$(CONFIG_MODE_TT) += tt/
27 obj-$(CONFIG_MODE_SKAS) += skas/
28
29 user-objs-$(CONFIG_TTY_LOG) += tty_log.o
30
31 USER_OBJS := $(filter %_user.o,$(obj-y))  $(user-objs-y) config.o helper.o \
32         process.o tempfile.o time.o tty_log.o umid.o user_util.o
33 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
34
35 CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS))
36
37 # This has to be separate because it needs be compiled with frame pointers
38 # regardless of how the rest of the kernel is built.
39
40 $(obj)/frame.o: $(src)/frame.c
41         $(CC) $(CFLAGS_$(notdir $@)) -c -o $@ $<
42
43 $(USER_OBJS) : %.o: %.c
44         $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
45
46 QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/; print $$_ }'
47
48 $(obj)/config.o : $(obj)/config.c
49
50 quiet_cmd_quote = QUOTE $@
51 cmd_quote = $(PERL) -e $(QUOTE) < $< > $@
52
53 targets += config.c
54 $(obj)/config.c : $(src)/config.c.in $(TOPDIR)/.config FORCE
55         $(call if_changed,quote)