Subversion Repositories HelenOS

Rev

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

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