Subversion Repositories HelenOS

Rev

Rev 3022 | Rev 4201 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3022 Rev 4055
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 \
-
 
53
	generic/pcb.c \
-
 
54
	generic/smc.c \
54
	generic/thread.c \
55
	generic/thread.c \
55
	generic/tls.c \
56
	generic/tls.c \
56
	generic/task.c \
57
	generic/task.c \
57
	generic/futex.c \
58
	generic/futex.c \
-
 
59
	generic/io/asprintf.c \
58
	generic/io/io.c \
60
	generic/io/io.c \
59
	generic/io/printf.c \
61
	generic/io/printf.c \
-
 
62
	generic/io/fprintf.c \
-
 
63
	generic/io/stdio.c \
60
	generic/io/stream.c \
64
	generic/io/stream.c \
61
	generic/io/sprintf.c \
65
	generic/io/sprintf.c \
62
	generic/io/snprintf.c \
66
	generic/io/snprintf.c \
63
	generic/io/vprintf.c \
67
	generic/io/vprintf.c \
64
	generic/io/vsprintf.c \
68
	generic/io/vsprintf.c \
Line 66... Line 70...
66
	generic/io/printf_core.c \
70
	generic/io/printf_core.c \
67
	malloc/malloc.c \
71
	malloc/malloc.c \
68
	generic/sysinfo.c \
72
	generic/sysinfo.c \
69
	generic/ipc.c \
73
	generic/ipc.c \
70
	generic/async.c \
74
	generic/async.c \
-
 
75
	generic/loader.c \
-
 
76
	generic/getopt.c \
71
	generic/libadt/list.o \
77
	generic/libadt/list.o \
72
	generic/libadt/hash_table.o \
78
	generic/libadt/hash_table.o \
73
	generic/time.c \
79
	generic/time.c \
74
	generic/err.c \
80
	generic/err.c \
75
	generic/stdlib.c \
81
	generic/stdlib.c \
-
 
82
	generic/kbd.c \
76
	generic/mman.c \
83
	generic/mman.c \
-
 
84
	generic/udebug.c \
77
	generic/vfs/vfs.c \
85
	generic/vfs/vfs.c \
78
	generic/vfs/canonify.c
86
	generic/vfs/canonify.c
79
 
87
 
80
ARCH_SOURCES += \
88
ARCH_SOURCES += \
81
	arch/$(ARCH)/src/entry.s \
89
	arch/$(UARCH)/src/entry.s \
82
	arch/$(ARCH)/src/thread_entry.s
90
	arch/$(UARCH)/src/thread_entry.s
83
 
91
 
84
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
92
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
85
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
93
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
-
 
94
OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS)
86
 
95
 
87
.PHONY: all clean depend kerninc
96
.PHONY: all clean depend kerninc
88
 
97
 
89
all: kerninc libc.a arch/$(ARCH)/_link.ld
98
all: kerninc libc.a arch/$(UARCH)/_link.ld
90
 
99
 
91
kerninc:
100
kerninc:
92
	ln -sfn ../../../../kernel/generic/include include/kernel
101
	ln -sfn ../../../../kernel/generic/include include/kernel
93
	ln -sfn kernel/arch include/arch
102
	ln -sfn kernel/arch include/arch
94
	ln -sfn ../arch/$(ARCH)/include include/libarch
103
	ln -sfn ../arch/$(UARCH)/include include/libarch
95
 
104
 
96
-include Makefile.depend
105
-include Makefile.depend
97
 
106
 
98
clean:
107
clean:
99
	-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
100
	find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \;
109
	find generic/ arch/$(UARCH)/ malloc -name '*.o' -follow -exec rm \{\} \;
101
 
110
 
102
depend: kerninc
111
depend: kerninc
103
	-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
104
 
113
 
105
libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
114
libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
106
	$(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
115
	$(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
107
 
116
 
108
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
117
arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in
109
	$(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 "^\#" > $@
110
 
119
 
111
%.o: %.S
120
%.o: %.S
112
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
121
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
113
 
122