Subversion Repositories HelenOS

Rev

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

Rev 3042 Rev 3425
Line 30... Line 30...
30
include ../../../Makefile.config
30
include ../../../Makefile.config
31
 
31
 
32
## Toolchain configuration
32
## Toolchain configuration
33
#
33
#
34
 
34
 
-
 
35
ifndef CROSS_PREFIX
-
 
36
	CROSS_PREFIX = /usr/local
-
 
37
endif
-
 
38
 
35
BFD_NAME = elf32-littlearm
39
BFD_NAME = elf32-littlearm
36
BFD_ARCH = arm
40
BFD_ARCH = arm
37
TARGET = arm-linux-gnu
41
TARGET = arm-linux-gnu
38
TOOLCHAIN_DIR = /usr/local/arm/bin
42
TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm/bin
39
 
43
 
40
ifeq ($(COMPILER),gcc_native)
44
ifeq ($(COMPILER),gcc_native)
41
	CC = gcc
45
	CC = gcc
42
	AS = as
46
	AS = as
43
	LD = ld
47
	LD = ld
Line 78... Line 82...
78
	../../../genarch/division.c
82
	../../../genarch/division.c
79
 
83
 
80
COMPONENTS = \
84
COMPONENTS = \
81
	$(KERNELDIR)/kernel.bin \
85
	$(KERNELDIR)/kernel.bin \
82
	$(USPACEDIR)/srv/ns/ns \
86
	$(USPACEDIR)/srv/ns/ns \
-
 
87
	$(USPACEDIR)/srv/loader/loader \
-
 
88
	$(USPACEDIR)/app/init/init \
-
 
89
	$(USPACEDIR)/srv/devmap/devmap \
-
 
90
	$(USPACEDIR)/srv/rd/rd \
-
 
91
	$(USPACEDIR)/srv/vfs/vfs
-
 
92
ifeq ($(RDFMT),tmpfs)
-
 
93
	COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
-
 
94
endif
-
 
95
ifeq ($(RDFMT),fat)
-
 
96
	COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
-
 
97
endif
-
 
98
 
-
 
99
RD_SRVS = \
83
	$(USPACEDIR)/srv/fb/fb \
100
	$(USPACEDIR)/srv/fb/fb \
84
	$(USPACEDIR)/srv/kbd/kbd \
101
	$(USPACEDIR)/srv/kbd/kbd \
85
	$(USPACEDIR)/srv/console/console \
102
	$(USPACEDIR)/srv/console/console \
86
	$(USPACEDIR)/srv/vfs/vfs \
-
 
87
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
103
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
88
	$(USPACEDIR)/srv/fs/fat/fat \
104
	$(USPACEDIR)/srv/fs/fat/fat
89
	$(USPACEDIR)/srv/devmap/devmap \
-
 
-
 
105
 
90
	$(USPACEDIR)/app/init/init \
106
RD_APPS = \
91
	$(USPACEDIR)/app/tetris/tetris \
107
	$(USPACEDIR)/app/tetris/tetris \
92
	$(USPACEDIR)/app/tester/tester \
108
	$(USPACEDIR)/app/tester/tester \
93
	$(USPACEDIR)/app/tetris/tetris \
-
 
94
	$(USPACEDIR)/app/sctrace/sctrace \
109
	$(USPACEDIR)/app/sctrace/sctrace \
95
	$(USPACEDIR)/app/klog/klog
110
	$(USPACEDIR)/app/klog/klog \
-
 
111
	$(USPACEDIR)/app/bdsh/bdsh
96
 
112
 
97
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
113
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
98
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
114
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
99
 
115
 
100
.PHONY: all clean depend
116
.PHONY: all clean depend
101
 
117
 
102
all: image.boot
118
all: image.boot
103
 
119
 
104
-include Makefile.depend
120
-include Makefile.depend
105
 
121
 
106
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS)
122
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
107
	$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
123
	$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
108
 
124
 
109
depend:
125
depend:
110
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
126
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
111
 
127
 
112
clean:
128
clean:
-
 
129
	-for file in $(RD_SRVS) ; do \
-
 
130
		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
-
 
131
	done
-
 
132
	-for file in $(RD_APPS) ; do \
-
 
133
		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
-
 
134
	done
113
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend
135
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot Makefile.depend
114
 
136
 
115
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in
137
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
-
 
138
	for file in $(RD_SRVS) ; do \
-
 
139
		cp $$file $(USPACEDIR)/dist/srv/ ; \
-
 
140
	done
-
 
141
	for file in $(RD_APPS) ; do \
-
 
142
		cp $$file $(USPACEDIR)/dist/app/ ; \
-
 
143
	done
-
 
144
ifeq ($(RDFMT),tmpfs)
-
 
145
	../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
-
 
146
endif
-
 
147
ifeq ($(RDFMT),fat)
-
 
148
	../../../../tools/mkfat.sh $(USPACEDIR)/dist/ initrd.fs
-
 
149
endif
-
 
150
	../../../../tools/mkhord.py 4096 initrd.fs initrd.img
-
 
151
	rm initrd.fs
116
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS)
152
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) ./initrd.img
117
 
153
 
118
%.o: %.S
154
%.o: %.S
119
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
155
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
120
 
156
 
121
%.o: %.c
157
%.o: %.c