Subversion Repositories HelenOS

Rev

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

Rev 3474 Rev 3535
Line 55... Line 55...
55
	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
55
	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
56
	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
56
	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
57
	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
57
	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
58
endif
58
endif
59
 
59
 
60
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 -pipe
61
 
61
 
62
ifdef REVISION
62
ifdef REVISION
63
	CFLAGS += "-DREVISION=\"$(REVISION)\""
63
	CFLAGS += "-DREVISION=\"$(REVISION)\""
64
endif
64
endif
65
 
65
 
Line 77... Line 77...
77
	../../../genarch/ofw_tree.c \
77
	../../../genarch/ofw_tree.c \
78
	ofwarch.c \
78
	ofwarch.c \
79
	asm.S \
79
	asm.S \
80
	boot.S
80
	boot.S
81
 
81
 
-
 
82
#
-
 
83
# All components that go to image.boot without the ramdisk.
-
 
84
#
82
COMPONENTS = \
85
COMPONENTS = \
83
	$(KERNELDIR)/kernel.bin \
86
	$(KERNELDIR)/kernel.bin \
84
	$(USPACEDIR)/srv/ns/ns \
87
	$(USPACEDIR)/srv/ns/ns \
85
	$(USPACEDIR)/app/init/init \
88
	$(USPACEDIR)/app/init/init \
86
	$(USPACEDIR)/srv/loader/loader \
89
	$(USPACEDIR)/srv/loader/loader \
Line 92... Line 95...
92
endif
95
endif
93
ifeq ($(RDFMT),fat)
96
ifeq ($(RDFMT),fat)
94
	COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
97
	COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
95
endif
98
endif
96
 
99
 
-
 
100
#
-
 
101
# Final list of all components that go to image.boot.
-
 
102
#
-
 
103
ALL_COMPONENTS = $(COMPONENTS)
-
 
104
ifeq ($(CONFIG_RD_EXTERNAL),n)
-
 
105
	ALL_COMPONENTS += ./initrd.img
-
 
106
endif
-
 
107
 
97
RD_SRVS = \
108
RD_SRVS = \
98
	$(USPACEDIR)/srv/fb/fb \
109
	$(USPACEDIR)/srv/fb/fb \
99
	$(USPACEDIR)/srv/kbd/kbd \
110
	$(USPACEDIR)/srv/kbd/kbd \
100
	$(USPACEDIR)/srv/console/console \
111
	$(USPACEDIR)/srv/console/console \
101
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
112
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
Line 107... Line 118...
107
	$(USPACEDIR)/app/trace/trace \
118
	$(USPACEDIR)/app/trace/trace \
108
	$(USPACEDIR)/app/bdsh/bdsh \
119
	$(USPACEDIR)/app/bdsh/bdsh \
109
	$(USPACEDIR)/app/klog/klog
120
	$(USPACEDIR)/app/klog/klog
110
 
121
 
111
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
122
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
112
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
123
ALL_COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(ALL_COMPONENTS))))
113
 
124
 
114
.PHONY: all clean depend
125
.PHONY: all clean depend
115
 
126
 
116
all: image.boot disasm
127
all: image.boot disasm
117
 
128
 
118
-include Makefile.depend
129
-include Makefile.depend
119
 
130
 
120
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS)
131
image.boot: depend _components.h _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS)
121
	$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
132
	$(LD) -Map image.map -no-check-sections -N -T _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS) -o $@
122
 
133
 
123
depend:
134
depend:
124
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
135
	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
125
 
136
 
126
clean:
137
clean:
127
	-for file in $(RD_SRVS) ; do \
138
	-for file in $(RD_SRVS) ; do \
128
		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
139
		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
129
	done
140
	done
130
	-for file in $(RD_APPS) ; do \
141
	-for file in $(RD_APPS) ; do \
131
		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
142
		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
132
	done
143
	done
133
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend
144
	-rm -f _components.h _components.c _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend
134
 
145
 
135
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
146
_components.h _components.c _link.ld $(ALL_COMPONENT_OBJECTS): $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
136
	for file in $(RD_SRVS) ; do \
147
	for file in $(RD_SRVS) ; do \
137
		cp $$file $(USPACEDIR)/dist/srv/ ; \
148
		cp $$file $(USPACEDIR)/dist/srv/ ; \
138
	done
149
	done
139
	for file in $(RD_APPS) ; do \
150
	for file in $(RD_APPS) ; do \
140
		cp $$file $(USPACEDIR)/dist/app/ ; \
151
		cp $$file $(USPACEDIR)/dist/app/ ; \
141
	done
152
	done
142
ifeq ($(RDFMT),tmpfs)
153
ifeq ($(RDFMT),tmpfs)
143
	../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
154
	../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
144
endif
155
endif
145
ifeq ($(RDFMT),fat)
156
ifeq ($(RDFMT),fat)
146
	../../../../tools/mkfat.sh $(USPACEDIR)/dist/ initrd.fs
157
	../../../../tools/mkfat.py $(USPACEDIR)/dist/ initrd.fs
147
endif
158
endif
148
	../../../../tools/mkhord.py 16384 initrd.fs initrd.img
159
	../../../../tools/mkhord.py 16384 initrd.fs initrd.img
149
	rm initrd.fs
160
	rm initrd.fs
150
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS)
161
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(ALL_COMPONENTS)
151
 
162
 
152
%.o: %.S
163
%.o: %.S
153
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
164
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
154
 
165
 
155
%.o: %.c
166
%.o: %.c