Subversion Repositories HelenOS

Rev

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

Rev 2832 Rev 3042
Line 25... Line 25...
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
#
27
#
28
 
28
 
29
include ../../../../version
29
include ../../../../version
30
include ../../../../Makefile.config
30
include ../../../Makefile.config
31
 
31
 
32
## Toolchain configuration
32
## Toolchain configuration
33
#
33
#
34
 
34
 
-
 
35
BFD_NAME = elf32-littlearm
-
 
36
BFD_ARCH = arm
35
TARGET = arm-linux-gnu
37
TARGET = arm-linux-gnu
36
TOOLCHAIN_DIR = /usr/local/arm/bin
38
TOOLCHAIN_DIR = /usr/local/arm/bin
37
 
39
 
38
ifeq ($(COMPILER),native)
40
ifeq ($(COMPILER),gcc_native)
39
	CC = gcc
41
	CC = gcc
40
	AS = as
42
	AS = as
41
	LD = ld
43
	LD = ld
42
	OBJCOPY = objcopy
44
	OBJCOPY = objcopy
43
	OBJDUMP = objdump
45
	OBJDUMP = objdump
44
else
46
endif
-
 
47
 
-
 
48
ifeq ($(COMPILER),gcc_cross)
45
	CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
49
	CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
46
	AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
50
	AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
47
	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
51
	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
48
	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
52
	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
49
	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
53
	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
Line 66... Line 70...
66
SOURCES = \
70
SOURCES = \
67
	main.c \
71
	main.c \
68
	boot.S \
72
	boot.S \
69
	asm.S \
73
	asm.S \
70
	mm.c \
74
	mm.c \
-
 
75
	print/gxemul.c \
-
 
76
	_components.c \
71
	../../../generic/printf.c \
77
	../../../generic/printf.c \
72
	../../../genarch/division.c
78
	../../../genarch/division.c
73
 
79
 
74
ifeq ($(MACHINE), gxemul_testarm)
-
 
75
	SOURCES += print/gxemul.c
-
 
76
endif
-
 
77
 
-
 
78
 
-
 
79
COMPONENTS = \
80
COMPONENTS = \
80
	$(KERNELDIR)/kernel.bin \
81
	$(KERNELDIR)/kernel.bin \
81
	$(USPACEDIR)/srv/ns/ns \
82
	$(USPACEDIR)/srv/ns/ns \
-
 
83
	$(USPACEDIR)/srv/fb/fb \
82
	$(USPACEDIR)/srv/kbd/kbd \
84
	$(USPACEDIR)/srv/kbd/kbd \
83
	$(USPACEDIR)/srv/console/console \
85
	$(USPACEDIR)/srv/console/console \
84
	$(USPACEDIR)/srv/fb/fb \
-
 
85
	$(USPACEDIR)/srv/vfs/vfs \
86
	$(USPACEDIR)/srv/vfs/vfs \
86
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
87
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
87
	$(USPACEDIR)/srv/fs/fat/fat \
88
	$(USPACEDIR)/srv/fs/fat/fat \
88
	$(USPACEDIR)/srv/devmap/devmap \
89
	$(USPACEDIR)/srv/devmap/devmap \
89
	$(USPACEDIR)/app/init/init \
90
	$(USPACEDIR)/app/init/init \
-
 
91
	$(USPACEDIR)/app/tetris/tetris \
90
	$(USPACEDIR)/app/tester/tester \
92
	$(USPACEDIR)/app/tester/tester \
91
	$(USPACEDIR)/app/klog/klog \
93
	$(USPACEDIR)/app/tetris/tetris \
92
	$(USPACEDIR)/app/sctrace/sctrace \
94
	$(USPACEDIR)/app/sctrace/sctrace \
93
	$(USPACEDIR)/app/tetris/tetris
95
	$(USPACEDIR)/app/klog/klog
94
 
96
 
95
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
97
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
96
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
98
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
97
 
99
 
98
.PHONY: all clean depend
100
.PHONY: all clean depend
99
 
101
 
100
all: image.boot
102
all: image.boot
101
 
103
 
102
-include Makefile.depend
104
-include Makefile.depend
103
 
105
 
104
image.boot: depend _components.h _link.ld $(OBJECTS) $(COMPONENT_OBJECTS)
106
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS)
105
	$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ 
107
	$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
106
 
108
 
107
depend:
109
depend:
108
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
110
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
109
 
111
 
110
clean:
112
clean:
111
	-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend 
113
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend
112
 
114
 
113
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS)
115
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in
114
	./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS)
116
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS)
115
 
117
 
116
%.o: %.S
118
%.o: %.S
117
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
119
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
118
 
120
 
119
%.o: %.c
121
%.o: %.c