Subversion Repositories HelenOS

Rev

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

Rev 3386 Rev 4153
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
ifndef CROSS_PREFIX
35
ifndef CROSS_PREFIX
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../../.. -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 
60
CFLAGS = -DRELEASE=$(RELEASE) -I. -I../../../generic -I../../.. -imacros ../../../../config.h -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -pipe
61
 
-
 
62
ifdef REVISION
-
 
63
	CFLAGS += "-DREVISION=\"$(REVISION)\""
-
 
64
endif
-
 
65
 
-
 
66
ifdef TIMESTAMP
-
 
67
	CFLAGS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
-
 
68
endif
-
 
69
 
-
 
70
ifdef MACHINE
-
 
71
	CFLAGS += "-DMACHINE=$(MACHINE)"
-
 
72
endif
-
 
73
 
61
 
74
SOURCES = \
62
SOURCES = \
75
	main.c \
63
	main.c \
76
	boot.S \
64
	boot.S \
77
	asm.S \
65
	asm.S \
78
	mm.c \
66
	mm.c \
79
	print/gxemul.c \
67
	print/gxemul.c \
80
	_components.c \
68
	_components.c \
81
	../../../generic/printf.c \
69
	../../../generic/printf.c \
-
 
70
	../../../generic/string.c \
82
	../../../genarch/division.c
71
	../../../genarch/division.c
83
 
72
 
84
COMPONENTS = \
73
COMPONENTS = \
85
	$(KERNELDIR)/kernel.bin \
74
	$(KERNELDIR)/kernel.bin \
86
	$(USPACEDIR)/srv/ns/ns \
75
	$(USPACEDIR)/srv/ns/ns \
Line 94... Line 83...
94
endif
83
endif
95
ifeq ($(RDFMT),fat)
84
ifeq ($(RDFMT),fat)
96
	COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
85
	COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
97
endif
86
endif
98
 
87
 
99
RD_TASKS = \
88
RD_SRVS = \
100
	$(USPACEDIR)/srv/fb/fb \
89
	$(USPACEDIR)/srv/fb/fb \
101
	$(USPACEDIR)/srv/kbd/kbd \
90
	$(USPACEDIR)/srv/kbd/kbd \
102
	$(USPACEDIR)/srv/console/console \
91
	$(USPACEDIR)/srv/console/console \
103
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
92
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
104
	$(USPACEDIR)/srv/fs/fat/fat \
93
	$(USPACEDIR)/srv/fs/fat/fat
-
 
94
 
-
 
95
RD_APPS = \
105
	$(USPACEDIR)/app/tetris/tetris \
96
	$(USPACEDIR)/app/tetris/tetris \
106
	$(USPACEDIR)/app/tester/tester \
97
	$(USPACEDIR)/app/tester/tester \
-
 
98
	$(USPACEDIR)/app/trace/trace \
107
	$(USPACEDIR)/app/klog/klog \
99
	$(USPACEDIR)/app/klog/klog \
108
	$(USPACEDIR)/app/bdsh/bdsh
100
	$(USPACEDIR)/app/bdsh/bdsh
109
 
101
 
110
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
102
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
111
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
103
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
Line 118... Line 110...
118
 
110
 
119
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
111
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
120
	$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
112
	$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
121
 
113
 
122
depend:
114
depend:
123
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
115
	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
124
 
116
 
125
clean:
117
clean:
-
 
118
	-for file in $(RD_SRVS) ; do \
-
 
119
		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
-
 
120
	done
126
	-for task in $(RD_TASKS) ; do \
121
	-for file in $(RD_APPS) ; do \
127
		rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
122
		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
128
	done
123
	done
129
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot Makefile.depend
124
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot Makefile.depend
130
 
125
 
131
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) _link.ld.in
126
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
-
 
127
	for file in $(RD_SRVS) ; do \
-
 
128
		cp $$file $(USPACEDIR)/dist/srv/ ; \
-
 
129
	done
132
	for task in $(RD_TASKS) ; do \
130
	for file in $(RD_APPS) ; do \
133
		cp $$task $(USPACEDIR)/dist/sbin/ ; \
131
		cp $$file $(USPACEDIR)/dist/app/ ; \
134
	done
132
	done
135
ifeq ($(RDFMT),tmpfs)
133
ifeq ($(RDFMT),tmpfs)
136
	../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
134
	../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
137
endif
135
endif
138
ifeq ($(RDFMT),fat)
136
ifeq ($(RDFMT),fat)
139
	../../../../tools/mkfat.sh $(USPACEDIR)/dist/ initrd.fs
137
	../../../../tools/mkfat.py $(USPACEDIR)/dist/ initrd.fs
140
endif
138
endif
141
	../../../../tools/mkhord.py 4096 initrd.fs initrd.img
139
	../../../../tools/mkhord.py 4096 initrd.fs initrd.img
142
	rm initrd.fs
140
	rm initrd.fs
143
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) ./initrd.img
141
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) ./initrd.img
144
 
142