Subversion Repositories HelenOS

Rev

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

Rev 3803 Rev 3882
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
 
34
 
-
 
35
ifndef CROSS_PREFIX
-
 
36
	CROSS_PREFIX = /usr/local
-
 
37
endif
-
 
38
 
-
 
39
 
37
## Setup toolchain
40
## Setup toolchain
38
#
41
#
39
 
42
 
40
include $(LIBC_PREFIX)/Makefile.toolchain
43
include $(LIBC_PREFIX)/Makefile.toolchain
41
 
44
 
-
 
45
 
42
## Sources
46
## Sources
43
#
47
#
44
 
48
 
45
 
-
 
46
GENERIC_SOURCES = \
49
GENERIC_SOURCES = \
47
	generic/libc.c \
50
	generic/libc.c \
48
	generic/ddi.c \
51
	generic/ddi.c \
49
	generic/as.c \
52
	generic/as.c \
50
	generic/cap.c \
53
	generic/cap.c \
Line 85... Line 88...
85
	generic/udebug.c \
88
	generic/udebug.c \
86
	generic/vfs/vfs.c \
89
	generic/vfs/vfs.c \
87
	generic/vfs/canonify.c
90
	generic/vfs/canonify.c
88
 
91
 
89
ARCH_SOURCES += \
92
ARCH_SOURCES += \
90
	arch/$(ARCH)/src/entry.s \
93
	arch/$(UARCH)/src/entry.s \
91
	arch/$(ARCH)/src/thread_entry.s
94
	arch/$(UARCH)/src/thread_entry.s
92
 
95
 
93
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
96
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
94
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
97
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
95
OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS)
98
OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS)
96
 
99
 
97
.PHONY: all clean depend kerninc
100
.PHONY: all clean depend kerninc
98
 
101
 
99
all: kerninc libc.a arch/$(ARCH)/_link.ld
102
all: kerninc libc.a arch/$(UARCH)/_link.ld
100
 
103
 
101
kerninc:
104
kerninc:
102
	ln -sfn ../../../../kernel/generic/include include/kernel
105
	ln -sfn ../../../../kernel/generic/include include/kernel
103
	ln -sfn kernel/arch include/arch
106
	ln -sfn kernel/arch include/arch
104
	ln -sfn ../arch/$(ARCH)/include include/libarch
107
	ln -sfn ../arch/$(UARCH)/include include/libarch
105
 
108
 
106
-include Makefile.depend
109
-include Makefile.depend
107
 
110
 
108
clean:
111
clean:
109
	-rm -f include/kernel include/arch include/libarch libc.a arch/$(ARCH)/_link.ld Makefile.depend
112
	-rm -f include/kernel include/arch include/libarch libc.a arch/$(UARCH)/_link.ld Makefile.depend
110
	find generic/ arch/$(ARCH)/ malloc -name '*.o' -follow -exec rm \{\} \;
113
	find generic/ arch/$(UARCH)/ malloc -name '*.o' -follow -exec rm \{\} \;
111
 
114
 
112
depend: kerninc
115
depend: kerninc
113
	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
116
	-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
114
 
117
 
115
libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
118
libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
116
	$(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
119
	$(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
117
 
120
 
118
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
121
arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in
119
	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
122
	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
120
 
123
 
121
%.o: %.S
124
%.o: %.S
122
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
125
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
123
 
126