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