Subversion Repositories HelenOS

Rev

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

Rev 2832 Rev 3042
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
BFD_NAME = elf64-ia64-little
-
 
36
BFD_ARCH = ia64
35
TARGET = ia64-pc-linux-gnu
37
TARGET = ia64-pc-linux-gnu
36
TOOLCHAIN_DIR = /usr/local/ia64/bin
38
TOOLCHAIN_DIR = /usr/local/ia64/bin
37
 
39
 
38
ifeq ($(COMPILER),gcc_native)
40
ifeq ($(COMPILER),gcc_native)
39
	CC = gcc
41
	CC = gcc
Line 75... Line 77...
75
SOURCES = \
77
SOURCES = \
76
	main.c \
78
	main.c \
77
	../../../generic/printf.c \
79
	../../../generic/printf.c \
78
	../../../generic/string.c \
80
	../../../generic/string.c \
79
	../../../genarch/balloc.c \
81
	../../../genarch/balloc.c \
-
 
82
	_components.c \
80
	asm.S \
83
	asm.S \
81
	boot.S
84
	boot.S
82
 
85
 
83
COMPONENTS = \
86
COMPONENTS = \
84
	$(KERNELDIR)/kernel.bin \
87
	$(KERNELDIR)/kernel.bin \
Line 94... Line 97...
94
	$(USPACEDIR)/app/sctrace/sctrace \
97
	$(USPACEDIR)/app/sctrace/sctrace \
95
	$(USPACEDIR)/app/tetris/tetris \
98
	$(USPACEDIR)/app/tetris/tetris \
96
	$(USPACEDIR)/app/tester/tester \
99
	$(USPACEDIR)/app/tester/tester \
97
	$(USPACEDIR)/app/klog/klog
100
	$(USPACEDIR)/app/klog/klog
98
 
101
 
99
 
-
 
100
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
102
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
101
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
103
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
102
 
104
 
103
.PHONY: all clean depend
105
.PHONY: all clean depend
104
 
106
 
105
all: hello.efi disasm
107
all: hello.efi disasm
106
 
108
 
107
-include Makefile.depend
109
-include Makefile.depend
108
 
110
 
109
 
-
 
110
hello.efi: image.boot
111
hello.efi: image.boot
111
	make -C gefi/HelenOS PREFIX=$(GEFI_PREFIX)
112
	make -C gefi/HelenOS PREFIX=$(GEFI_PREFIX)
112
	cp gefi/HelenOS/hello.efi ../../../../
113
	cp gefi/HelenOS/hello.efi ../../../../
113
#	cp gefi/HelenOS/hello.efi /boot/efi/
114
#	cp gefi/HelenOS/hello.efi /boot/efi/
114
	cp gefi/HelenOS/image.bin ../../../../
115
	cp gefi/HelenOS/image.bin ../../../../
115
 
116
 
116
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS)
117
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS)
117
	$(LD) -Map boot.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
118
	$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
118
 
119
 
119
depend:
120
depend:
120
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
121
	-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
121
 
122
 
122
clean:
123
clean:
123
	-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot boot.disasm Makefile.depend
124
	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot image.map image.disasm Makefile.depend
124
	make -C gefi/HelenOS clean
125
	make -C gefi/HelenOS clean
125
 
126
 
126
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS)
127
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in
127
	./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS)
128
	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 16384 "unsigned long" $(COMPONENTS)
128
 
129
 
129
%.o: %.S
130
%.o: %.S
130
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
131
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
131
 
132
 
132
%.o: %.c
133
%.o: %.c
133
	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
134
	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
134
 
135
 
135
disasm: image.boot
136
disasm: image.boot
136
	$(OBJDUMP) -d image.boot > boot.disasm
137
	$(OBJDUMP) -d image.boot > image.disasm