Subversion Repositories HelenOS

Rev

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

Rev 3424 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 = elf64-sparc
39
BFD_NAME = elf64-sparc
36
BFD_ARCH = sparc
40
BFD_ARCH = sparc
37
TARGET = sparc64-linux-gnu
41
TARGET = sparc64-linux-gnu
38
TOOLCHAIN_DIR = /usr/local/sparc64/bin
42
TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/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 51... Line 55...
51
	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
55
	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
52
	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
56
	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
53
	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
57
	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
54
endif
58
endif
55
 
59
 
56
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=ultrasparc -m64
60
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=ultrasparc -m64 -mno-fpu
57
 
61
 
58
ifdef REVISION
62
ifdef REVISION
59
	CFLAGS += "-DREVISION=\"$(REVISION)\""
63
	CFLAGS += "-DREVISION=\"$(REVISION)\""
60
endif
64
endif
61
 
65
 
Line 77... Line 81...
77
 
81
 
78
COMPONENTS = \
82
COMPONENTS = \
79
	$(KERNELDIR)/kernel.bin \
83
	$(KERNELDIR)/kernel.bin \
80
	$(USPACEDIR)/srv/ns/ns \
84
	$(USPACEDIR)/srv/ns/ns \
81
	$(USPACEDIR)/app/init/init \
85
	$(USPACEDIR)/app/init/init \
-
 
86
	$(USPACEDIR)/srv/loader/loader \
82
	$(USPACEDIR)/srv/devmap/devmap \
87
	$(USPACEDIR)/srv/devmap/devmap \
83
	$(USPACEDIR)/srv/rd/rd \
88
	$(USPACEDIR)/srv/rd/rd \
84
	$(USPACEDIR)/srv/vfs/vfs \
89
	$(USPACEDIR)/srv/vfs/vfs
-
 
90
ifeq ($(RDFMT),tmpfs)
85
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs
91
	COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
-
 
92
endif
-
 
93
ifeq ($(RDFMT),fat)
-
 
94
	COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
-
 
95
endif
86
 
96
 
87
RD_TASKS = \
97
RD_SRVS = \
88
	$(USPACEDIR)/srv/fb/fb \
98
	$(USPACEDIR)/srv/fb/fb \
89
	$(USPACEDIR)/srv/kbd/kbd \
99
	$(USPACEDIR)/srv/kbd/kbd \
90
	$(USPACEDIR)/srv/console/console \
100
	$(USPACEDIR)/srv/console/console \
-
 
101
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
91
	$(USPACEDIR)/srv/fs/fat/fat \
102
	$(USPACEDIR)/srv/fs/fat/fat
-
 
103
 
-
 
104
RD_APPS = \
92
	$(USPACEDIR)/app/sctrace/sctrace \
105
	$(USPACEDIR)/app/sctrace/sctrace \
93
	$(USPACEDIR)/app/tetris/tetris \
106
	$(USPACEDIR)/app/tetris/tetris \
94
	$(USPACEDIR)/app/tester/tester \
107
	$(USPACEDIR)/app/tester/tester \
-
 
108
	$(USPACEDIR)/app/bdsh/bdsh \
95
	$(USPACEDIR)/app/klog/klog
109
	$(USPACEDIR)/app/klog/klog
96
 
110
 
97
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
111
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
98
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
112
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
99
 
113
 
Line 101... Line 115...
101
 
115
 
102
all: image.boot disasm
116
all: image.boot disasm
103
 
117
 
104
-include Makefile.depend
118
-include Makefile.depend
105
 
119
 
106
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
120
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS)
107
	$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
121
	$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
108
 
122
 
109
depend:
123
depend:
110
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
124
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
111
 
125
 
112
clean:
126
clean:
113
	-for task in $(RD_TASKS) ; do \
127
	-for file in $(RD_SRVS) ; do \
114
		rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
128
		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
115
	done
129
	done
-
 
130
	-for file in $(RD_APPS) ; do \
-
 
131
		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
-
 
132
	done
116
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend
133
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend
117
 
134
 
118
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_TASKS) _link.ld.in
135
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
-
 
136
	for file in $(RD_SRVS) ; do \
-
 
137
		cp $$file $(USPACEDIR)/dist/srv/ ; \
-
 
138
	done
119
	for task in $(RD_TASKS) ; do \
139
	for file in $(RD_APPS) ; do \
120
		cp $$task $(USPACEDIR)/dist/sbin/ ; \
140
		cp $$file $(USPACEDIR)/dist/app/ ; \
121
	done
141
	done
-
 
142
ifeq ($(RDFMT),tmpfs)
122
	../../../../tools/mktmpfs.py 16384 $(USPACEDIR)/dist/ initrd.img
143
	../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
-
 
144
endif
-
 
145
ifeq ($(RDFMT),fat)
-
 
146
	../../../../tools/mkfat.sh $(USPACEDIR)/dist/ initrd.fs
-
 
147
endif
-
 
148
	../../../../tools/mkhord.py 16384 initrd.fs initrd.img
-
 
149
	rm initrd.fs
123
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS) ./initrd.img
150
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS)
124
 
151
 
125
%.o: %.S
152
%.o: %.S
126
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
153
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
127
 
154
 
128
%.o: %.c
155
%.o: %.c