Subversion Repositories HelenOS-historic

Rev

Rev 59 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59 Rev 76
1
include Makefile.config
1
include Makefile.config
2
include ../arch/$(ARCH)/Makefile.inc
2
include ../arch/$(ARCH)/Makefile.inc
3
 
3
 
4
sources=cpu/cpu.c \
4
sources=cpu/cpu.c \
5
	main/main.c \
5
	main/main.c \
6
	main/kinit.c \
6
	main/kinit.c \
7
	main/uinit.c \
7
	main/uinit.c \
8
	proc/scheduler.c \
8
	proc/scheduler.c \
9
	proc/thread.c \
9
	proc/thread.c \
10
	proc/task.c \
10
	proc/task.c \
11
	mm/heap.c \
11
	mm/heap.c \
12
	mm/frame.c \
12
	mm/frame.c \
13
	mm/page.c \
13
	mm/page.c \
14
	mm/tlb.c \
14
	mm/tlb.c \
15
	mm/vm.c \
15
	mm/vm.c \
16
	lib/func.c \
16
	lib/func.c \
17
	lib/list.c \
17
	lib/list.c \
18
	lib/memstr.c \
18
	lib/memstr.c \
19
	debug/print.c \
19
	debug/print.c \
20
	time/clock.c \
20
	time/clock.c \
21
	time/timeout.c \
21
	time/timeout.c \
22
	time/delay.c \
22
	time/delay.c \
23
	synch/spinlock.c \
23
	synch/spinlock.c \
24
	synch/condvar.c \
24
	synch/condvar.c \
25
	synch/rwlock.c \
25
	synch/rwlock.c \
26
	synch/mutex.c \
26
	synch/mutex.c \
27
	synch/semaphore.c \
27
	synch/semaphore.c \
28
	synch/waitq.c \
28
	synch/waitq.c \
29
	smp/ipi.c
29
	smp/ipi.c
30
 
30
 
31
ifdef DEBUG_SPINLOCK
31
ifdef DEBUG_SPINLOCK
32
CFLAGS+=-D$(DEBUG_SPINLOCK)
32
CFLAGS+=-D$(DEBUG_SPINLOCK)
33
endif
33
endif
34
 
34
 
35
ifdef USERSPACE
35
ifdef USERSPACE
36
CFLAGS+=-D$(USERSPACE)
36
CFLAGS+=-D$(USERSPACE)
37
endif
37
endif
38
 
38
 
39
ifdef TEST
39
ifdef TEST
40
test_objects:=$(addsuffix .o,$(basename ../test/$(TEST_DIR)/$(TEST_FILE)))
40
test_objects:=$(addsuffix .o,$(basename ../test/$(TEST_DIR)/$(TEST_FILE)))
41
CFLAGS+=-D$(TEST)
41
CFLAGS+=-D$(TEST)
42
endif
42
endif
43
arch_objects:=$(addsuffix .o,$(basename $(arch_sources)))
43
arch_objects:=$(addsuffix .o,$(basename $(arch_sources)))
44
objects:=$(addsuffix .o,$(basename $(sources)))
44
objects:=$(addsuffix .o,$(basename $(sources)))
45
 
45
 
46
.PHONY : all config depend build clean dist-clean boot
46
.PHONY : all config depend build clean dist-clean boot
47
 
47
 
48
all: dist-clean config depend build
48
all: dist-clean config depend build
49
 
49
 
50
-include Makefile.depend
50
-include Makefile.depend
51
 
51
 
52
config:
52
config:
53
	find . ../include -name arch -type l -exec rm \{\} \;
53
	find . ../include -name arch -type l -exec rm \{\} \;
54
	ln -s ../arch/$(ARCH)/src arch
54
	ln -s ../arch/$(ARCH)/src arch
55
	ln -s ../arch/$(ARCH)/include ../include/arch
55
	ln -s ../arch/$(ARCH)/include ../include/arch
56
 
56
 
57
depend:
57
depend:
58
	$(CC) $(CPPFLAGS) -M $(arch_sources) $(sources) >Makefile.depend
58
	$(CC) $(CPPFLAGS) -M $(arch_sources) $(sources) >Makefile.depend
59
 
59
 
60
build: kernel.bin boot
60
build: kernel.bin boot
61
 
61
 
62
clean:
62
clean:
63
	find . ../arch/$(ARCH)/src ../test -name '*.o' -exec rm \{\} \;
63
	find . ../arch/$(ARCH)/src ../test -name '*.o' -exec rm \{\} \;
64
	-rm *.bin kernel.map
64
	-rm *.bin kernel.map
65
	$(MAKE) -C ../arch/$(ARCH)/boot clean
65
	$(MAKE) -C ../arch/$(ARCH)/boot clean
66
 
66
 
67
dist-clean:
67
dist-clean:
68
	find . ../include -name arch -type l -exec rm \{\} \;
68
	find . ../include -name arch -type l -exec rm \{\} \;
69
	-rm Makefile.depend
69
	-rm Makefile.depend
70
	-$(MAKE) clean
70
	-$(MAKE) clean
71
 
71
 
72
kernel.bin: $(arch_objects) $(objects) $(test_objects)
72
kernel.bin: $(arch_objects) $(objects) $(test_objects)
73
	$(LD) $(LFLAGS) $(arch_objects) $(objects) $(test_objects) -o $@ >kernel.map
73
	$(LD) $(LFLAGS) $(arch_objects) $(objects) $(test_objects) -o $@ >kernel.map
74
 
74
 
75
%.s: %.S
75
%.s: %.S
76
	$(CC) $(CPPFLAGS) -E $< >$@
76
	$(CC) $(CPPFLAGS) -E $< >$@
77
 
77
 
78
%.o: %.s
78
%.o: %.s
79
	$(AS) $< -o $@
79
	$(AS) $(ASFLAGS) $< -o $@
80
 
80
 
81
%.o: %.c
81
%.o: %.c
82
	$(CC) $(CFLAGS) -c $< -o $@
82
	$(CC) $(CFLAGS) -c $< -o $@
83
 
83
 
84
KS=`cat kernel.bin | wc -c`
84
KS=`cat kernel.bin | wc -c`
85
 
85
 
86
boot:
86
boot:
87
	$(MAKE) -C ../arch/$(ARCH)/boot build KERNEL_SIZE=$(KS)
87
	$(MAKE) -C ../arch/$(ARCH)/boot build KERNEL_SIZE=$(KS)
88
 
88