Subversion Repositories HelenOS

Rev

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

Rev 550 Rev 558
Line 37... Line 37...
37
RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
37
RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
38
 
38
 
39
## Include configuration
39
## Include configuration
40
#
40
#
41
 
41
 
42
include Makefile.config
42
-include Makefile.config
43
 
43
 
44
## Common compiler flags
44
## Common compiler flags
45
#
45
#
46
 
46
 
47
DEFS = -DARCH=$(ARCH) -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\""
47
DEFS = -DARCH=$(ARCH) -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\""
Line 54... Line 54...
54
endif
54
endif
55
 
55
 
56
## Setup kernel configuration
56
## Setup kernel configuration
57
#
57
#
58
 
58
 
59
include arch/$(ARCH)/Makefile.inc
59
-include arch/$(ARCH)/Makefile.inc
60
include genarch/Makefile.inc
60
-include genarch/Makefile.inc
61
 
61
 
62
ifeq ($(CONFIG_DEBUG),y)
62
ifeq ($(CONFIG_DEBUG),y)
63
	DEFS += -DCONFIG_DEBUG
63
	DEFS += -DCONFIG_DEBUG
64
endif
64
endif
65
ifeq ($(CONFIG_DEBUG_SPINLOCK),y)
65
ifeq ($(CONFIG_DEBUG_SPINLOCK),y)
Line 136... Line 136...
136
 
136
 
137
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
137
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
138
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
138
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
139
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
139
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
140
 
140
 
141
.PHONY: all clean config depend boot
141
.PHONY: all clean config links depend boot
142
 
142
 
-
 
143
all:
-
 
144
	tools/config.py default
-
 
145
	$(MAKE) -C . real_all
-
 
146
 
143
all: kernel.bin boot disasm
147
real_all: kernel.bin boot disasm
-
 
148
 
-
 
149
config:
-
 
150
	tools/config.py
144
 
151
 
145
-include Makefile.depend
152
-include Makefile.depend
146
 
153
 
-
 
154
distclean: clean
-
 
155
	-rm Makefile.config
-
 
156
 
147
clean:
157
clean:
148
	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
158
	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
149
	find generic/src/ arch/$(ARCH)/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
159
	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
-
 
160
	for arch in arch/*; do \
-
 
161
	    [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null;\
150
	$(MAKE) -C arch/$(ARCH)/boot clean
162
	    $(MAKE) -C $$arch/boot clean; \
-
 
163
	done;exit 0
151
 
164
 
152
config:
165
archlinks:
153
	ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch
166
	ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch
154
	ln -sfn ../../genarch/include/ generic/include/genarch
167
	ln -sfn ../../genarch/include/ generic/include/genarch
155
 
168
 
156
depend: config
169
depend: archlinks
157
	$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
170
	$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
158
 
171
 
159
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
172
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
160
	$(CC) $(DEFS) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
173
	$(CC) $(DEFS) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
161
 
174