Rev 3386 | Rev 4581 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3386 | Rev 4153 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | ## Common compiler flags |
29 | ## Common compiler flags |
30 | # |
30 | # |
31 | 31 | ||
32 | LIBC_PREFIX = $(shell pwd) |
32 | LIBC_PREFIX = $(shell pwd) |
33 | SOFTINT_PREFIX = ../softint |
33 | SOFTINT_PREFIX = ../softint |
34 | CONSOLE_PREFIX = ../../srv/console |
- | |
35 | 34 | ||
36 | ## Setup toolchain |
35 | ## Setup toolchain |
37 | # |
36 | # |
38 | 37 | ||
39 | include $(LIBC_PREFIX)/Makefile.toolchain |
38 | include $(LIBC_PREFIX)/Makefile.toolchain |
40 | 39 | ||
41 | CFLAGS += -I$(CONSOLE_PREFIX) |
- | |
42 | 40 | ||
43 | ## Sources |
41 | ## Sources |
44 | # |
42 | # |
45 | 43 | ||
46 | - | ||
47 | GENERIC_SOURCES = \ |
44 | GENERIC_SOURCES = \ |
48 | generic/libc.c \ |
45 | generic/libc.c \ |
49 | generic/ddi.c \ |
46 | generic/ddi.c \ |
50 | generic/as.c \ |
47 | generic/as.c \ |
51 | generic/cap.c \ |
48 | generic/cap.c \ |
- | 49 | generic/console.c \ |
|
- | 50 | generic/mem.c \ |
|
52 | generic/string.c \ |
51 | generic/string.c \ |
53 | generic/fibril.c \ |
52 | generic/fibril.c \ |
54 | generic/pcb.c \ |
53 | generic/pcb.c \ |
55 | generic/smc.c \ |
54 | generic/smc.c \ |
56 | generic/thread.c \ |
55 | generic/thread.c \ |
Line 58... | Line 57... | ||
58 | generic/task.c \ |
57 | generic/task.c \ |
59 | generic/futex.c \ |
58 | generic/futex.c \ |
60 | generic/io/asprintf.c \ |
59 | generic/io/asprintf.c \ |
61 | generic/io/io.c \ |
60 | generic/io/io.c \ |
62 | generic/io/printf.c \ |
61 | generic/io/printf.c \ |
- | 62 | generic/io/fprintf.c \ |
|
- | 63 | generic/io/stdio.c \ |
|
63 | generic/io/stream.c \ |
64 | generic/io/stream.c \ |
64 | generic/io/sprintf.c \ |
65 | generic/io/sprintf.c \ |
65 | generic/io/snprintf.c \ |
66 | generic/io/snprintf.c \ |
66 | generic/io/vprintf.c \ |
67 | generic/io/vprintf.c \ |
67 | generic/io/vsprintf.c \ |
68 | generic/io/vsprintf.c \ |
Line 69... | Line 70... | ||
69 | generic/io/printf_core.c \ |
70 | generic/io/printf_core.c \ |
70 | malloc/malloc.c \ |
71 | malloc/malloc.c \ |
71 | generic/sysinfo.c \ |
72 | generic/sysinfo.c \ |
72 | generic/ipc.c \ |
73 | generic/ipc.c \ |
73 | generic/async.c \ |
74 | generic/async.c \ |
- | 75 | generic/loader.c \ |
|
74 | generic/getopt.c \ |
76 | generic/getopt.c \ |
75 | generic/libadt/list.o \ |
77 | generic/libadt/list.o \ |
76 | generic/libadt/hash_table.o \ |
78 | generic/libadt/hash_table.o \ |
77 | generic/time.c \ |
79 | generic/time.c \ |
78 | generic/err.c \ |
80 | generic/err.c \ |
79 | generic/stdlib.c \ |
81 | generic/stdlib.c \ |
- | 82 | generic/kbd.c \ |
|
80 | generic/mman.c \ |
83 | generic/mman.c \ |
- | 84 | generic/udebug.c \ |
|
81 | generic/vfs/vfs.c \ |
85 | generic/vfs/vfs.c \ |
82 | generic/vfs/canonify.c |
86 | generic/vfs/canonify.c |
83 | 87 | ||
84 | ARCH_SOURCES += \ |
88 | ARCH_SOURCES += \ |
85 | arch/$(ARCH)/src/entry.s \ |
89 | arch/$(UARCH)/src/entry.s \ |
86 | arch/$(ARCH)/src/thread_entry.s |
90 | arch/$(UARCH)/src/thread_entry.s |
87 | 91 | ||
88 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
92 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
89 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
93 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
- | 94 | OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS) |
|
90 | 95 | ||
91 | .PHONY: all clean depend kerninc |
96 | .PHONY: all clean depend kerninc |
92 | 97 | ||
93 | all: kerninc libc.a arch/$(ARCH)/_link.ld |
98 | all: kerninc libc.a arch/$(UARCH)/_link.ld |
94 | 99 | ||
95 | kerninc: |
100 | kerninc: |
96 | ln -sfn ../../../../kernel/generic/include include/kernel |
101 | ln -sfn ../../../../kernel/generic/include include/kernel |
97 | ln -sfn kernel/arch include/arch |
102 | ln -sfn kernel/arch include/arch |
98 | ln -sfn ../arch/$(ARCH)/include include/libarch |
103 | ln -sfn ../arch/$(UARCH)/include include/libarch |
99 | 104 | ||
100 | -include Makefile.depend |
105 | -include Makefile.depend |
101 | 106 | ||
102 | clean: |
107 | clean: |
103 | -rm -f include/kernel include/arch include/libarch libc.a arch/$(ARCH)/_link.ld Makefile.depend |
108 | -rm -f include/kernel include/arch include/libarch libc.a arch/$(UARCH)/_link.ld Makefile.depend |
104 | find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \; |
109 | find generic/ arch/$(UARCH)/ malloc -name '*.o' -follow -exec rm \{\} \; |
105 | 110 | ||
106 | depend: kerninc |
111 | depend: kerninc |
107 | -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
112 | -makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
108 | 113 | ||
109 | libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
114 | libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
110 | $(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
115 | $(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
111 | 116 | ||
112 | arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
117 | arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in |
113 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
118 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
114 | 119 | ||
115 | %.o: %.S |
120 | %.o: %.S |
116 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
121 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
117 | 122 |