]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/ux/Makerules.KERNEL
cbc0b468fa769fce8f9ae02853fd08122d9990cd
[l4.git] / kernel / fiasco / src / kern / ux / Makerules.KERNEL
1 # UX Kernel Makefile
2
3 shortcut.o:          $(TCBOFFSET)
4 sighandler.o:        $(TCBOFFSET)
5 entry.o:             $(TCBOFFSET)
6 entry-mp.o:          $(TCBOFFSET)
7 sys_call_page-asm.o: $(TCBOFFSET)
8 tramp-mp.o:          $(TCBOFFSET)
9
10
11 # Add future prerequisites somewhere among the list of libraries. You really
12 # should not have to add anything in the $(CXX) line.
13 #
14 # Please don't add -gc-sections as linker option here. The reason is that
15 # properly working destructors of libc.a require __start_libc_atexit and
16 # __stop_libc_atexit to be defined by the linker. The ld linker defines
17 # these symbols by magic if it finds a 'libc section' -- the section name
18 # starts with '_'. However, if the section is completely purged, these
19 # symbols are not defined and therefore the libc destructors are not executed
20 # (_IO_cleanup so far). We could manually create the correct section by adding
21 #
22 #   __libc_atexit : {
23 #     PROVIDE(__start___libc_atexit = .);
24 #     KEEP(*(__libc_atexit))
25 #     PROVIDE(__stop___libc_atexit = .);
26 #   }
27 #
28 # to the linker script. We don't do this because we don't know which symbols
29 # are required by future versions of the libc.
30
31 $(KERNEL):      kernel.ux.lds $(OBJ_KERNEL) $(MINILIBC) $(LIBK) $(KERNEL_EXTRA_LIBS) $(ABI) $(JABI) $(DRIVERS) $(CXXLIB)
32                 $(LINK_MESSAGE)
33                 $(VERBOSE)$(CXX) -m32 -Wl,-T$< -static -o $@ -Wl,--whole-archive $(MINILIBC) -Wl,--no-whole-archive $(KERNEL_UNRES_SYMS) $(filter-out $<,$+) -lutil $(WRAP_SYMBOLS)
34                 $(VERBOSE)chmod 755 $@
35                 @$(ECHO) "  ==> Generating fiasco"
36                 $(VERBOSE)ln -sf $@ fiasco
37                 $(VERBOSE)preinit_array_start=$$(nm $(KERNEL) | grep __preinit_array_start | cut -d' ' -f1); \
38                   preinit_array_end=$$(nm $(KERNEL) | grep __preinit_array_end   | cut -d' ' -f1); \
39                   if [ "$$preinit_array_start" != "$$preinit_array_end" ]; then \
40                     echo "preinit_array content appeared, check linker symbols"; \
41                   fi
42
43 irq0.o:         irq0.c
44                 $(COMP_MESSAGE)
45                 $(VERBOSE)$(CC) -O2 -Wall -W -c -o $@ $<
46
47 irq0:           irq0.o
48                 $(LINK_MESSAGE)
49                 $(VERBOSE)$(CC) -static -o $@ $<
50                 $(STRIP_MESSAGE)
51                 $(VERBOSE)$(STRIP) $@
52
53 ifeq ($(CONFIG_UX_CON),y)
54
55 SDL_CFLAGS  := $(shell $(SYSTEM_TARGET)sdl-config --cflags)
56 SDL_LDFLAGS := $(shell $(SYSTEM_TARGET)sdl-config --libs)
57
58 ifeq ($(SDL_CFLAGS),)
59   $(error sdl-config not found. libsdl including header files installed?)
60 endif
61
62 ux_con.o:       ux_con.c
63                 $(COMP_MESSAGE)
64                 $(VERBOSE)$(CC) -O2 -Wall -W -g $(SDL_CFLAGS) -c $<
65
66 ux_con:         ux_con.o
67                 $(LINK_MESSAGE)
68                 $(VERBOSE)$(CC) $(SDL_LDFLAGS) $< -o $@
69                 $(STRIP_MESSAGE)
70                 $(VERBOSE)$(STRIP) $@
71 endif
72
73 ifeq ($(CONFIG_UX_NET),y)
74 ux_net.o:       ux_net.c
75                 $(COMP_MESSAGE)
76                 $(VERBOSE)$(CC) -O2 -Wall -W -g -c $<
77
78 ux_net:         ux_net.o
79                 $(LINK_MESSAGE)
80                 $(VERBOSE)$(CC) $< -o $@
81                 $(STRIP_MESSAGE)
82                 $(VERBOSE)$(STRIP) $@
83 endif