Makefile 2.47 KB
Newer Older
1 2 3 4 5
# 
# Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
# Licensed under the GPL
#

6
EXTRA_TARGETS	:= unmap_fin.o
7

8
obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \
9
	helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
10 11 12
	process.o process_kern.o ptrace.o reboot.o resource.o sigio_user.o \
	sigio_kern.o signal_kern.o signal_user.o smp.o syscall_kern.o \
	syscall_user.o sysrq.o sys_call_table.o tempfile.o time.o \
13 14
	time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o \
	umid.o user_syms.o user_util.o
15

16
obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o
17 18 19
obj-$(CONFIG_GPROF)	+= gprof_syms.o
obj-$(CONFIG_GCOV)	+= gmon_syms.o
obj-$(CONFIG_TTY_LOG)	+= tty_log.o
20

Jeff Dike's avatar
Jeff Dike committed
21
obj-$(CONFIG_MODE_TT) += tt/
22
obj-$(CONFIG_MODE_SKAS) += skas/
23

24
user-objs-$(CONFIG_TTY_LOG) += tty_log.o
25 26 27 28

# user_syms.o not included here because Rules.make has its own ideas about
# building anything in export-objs

29
USER_OBJS := $(filter %_user.o,$(obj-y))  $(user-objs-y) config.o helper.o \
30
	process.o tempfile.o time.o tty_log.o umid.o user_util.o user_syms.o
31
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
32 33 34 35

UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))

36 37
DMODULES-$(CONFIG_MODULES) = -D__CONFIG_MODULES__
DMODVERSIONS-$(CONFIG_MODVERSIONS) = -D__CONFIG_MODVERSIONS__
38

39 40
export-objs-$(CONFIG_GPROF) += gprof_syms.o
export-objs-$(CONFIG_GCOV) += gmon_syms.o
41

42
export-objs := ksyms.o process_kern.o signal_kern.o $(export-objs-y)
43

44
CFLAGS_user_syms.o = -D__AUTOCONF_INCLUDED__ $(DMODULES-y) $(DMODVERSIONS-y) \
45 46 47 48 49 50 51
	-I/usr/include -I../include

CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS))

$(USER_OBJS) : %.o: %.c
	$(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $<

52
$(obj)/unmap.o: $(src)/unmap.c
53 54
	$(CC) $(UNMAP_CFLAGS) -c -o $@ $<

55
$(obj)/unmap_fin.o : $(src)/unmap.o
56 57
	ld -r -o $@ $< -lc -L/usr/lib

58 59 60
# This has to be separate because it needs be compiled with frame pointers
# regardless of how the rest of the kernel is built.

61
$(obj)/frame.o: $(src)/frame.c
62
	$(CC) $(CFLAGS_$(notdir $@)) -c -o $@ $<
63

64 65
QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/; print $$_ }'

66 67
$(obj)/config.c : $(src)/config.c.in $(TOPDIR)/.config
	$(PERL) -e $(QUOTE) < $(src)/config.c.in > $@
68

69
$(obj)/config.o : $(obj)/config.c
70 71 72

clean:
	rm -f config.c
73
	for dir in $(subdir-y) ; do $(MAKE) -C $$dir clean; done
74 75 76 77 78 79 80 81 82

modules:

fastdep:

dep:

archmrproper: clean