Rev 3217 | Rev 3448 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3217 | Rev 3403 | ||
---|---|---|---|
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 80... | Line 84... | ||
80 | $(USPACEDIR)/srv/ns/ns \ |
84 | $(USPACEDIR)/srv/ns/ns \ |
81 | $(USPACEDIR)/app/init/init \ |
85 | $(USPACEDIR)/app/init/init \ |
82 | $(USPACEDIR)/srv/loader/loader \ |
86 | $(USPACEDIR)/srv/loader/loader \ |
83 | $(USPACEDIR)/srv/devmap/devmap \ |
87 | $(USPACEDIR)/srv/devmap/devmap \ |
84 | $(USPACEDIR)/srv/rd/rd \ |
88 | $(USPACEDIR)/srv/rd/rd \ |
85 | $(USPACEDIR)/srv/vfs/vfs \ |
89 | $(USPACEDIR)/srv/vfs/vfs |
- | 90 | ifeq ($(RDFMT),tmpfs) |
|
86 | $(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 |
|
87 | 96 | ||
88 | RD_TASKS = \ |
97 | RD_TASKS = \ |
89 | $(USPACEDIR)/srv/fb/fb \ |
98 | $(USPACEDIR)/srv/fb/fb \ |
90 | $(USPACEDIR)/srv/kbd/kbd \ |
99 | $(USPACEDIR)/srv/kbd/kbd \ |
91 | $(USPACEDIR)/srv/console/console \ |
100 | $(USPACEDIR)/srv/console/console \ |
- | 101 | $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ |
|
92 | $(USPACEDIR)/srv/fs/fat/fat \ |
102 | $(USPACEDIR)/srv/fs/fat/fat \ |
93 | $(USPACEDIR)/app/tetris/tetris \ |
103 | $(USPACEDIR)/app/tetris/tetris \ |
94 | $(USPACEDIR)/app/tester/tester \ |
104 | $(USPACEDIR)/app/tester/tester \ |
95 | $(USPACEDIR)/app/cli/cli \ |
105 | $(USPACEDIR)/app/bdsh/bdsh \ |
96 | $(USPACEDIR)/app/klog/klog |
106 | $(USPACEDIR)/app/klog/klog |
97 | 107 | ||
98 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
108 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
99 | COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
109 | COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
100 | 110 | ||
Line 102... | Line 112... | ||
102 | 112 | ||
103 | all: image.boot disasm |
113 | all: image.boot disasm |
104 | 114 | ||
105 | -include Makefile.depend |
115 | -include Makefile.depend |
106 | 116 | ||
107 | image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) |
117 | image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) |
108 | $(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@ |
118 | $(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
109 | 119 | ||
110 | depend: |
120 | depend: |
111 | -makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
121 | -makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
112 | 122 | ||
113 | clean: |
123 | clean: |
114 | -for task in $(RD_TASKS) ; do \ |
124 | -for task in $(RD_TASKS) ; do \ |
115 | rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \ |
125 | rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \ |
116 | done |
126 | done |
117 | -rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend |
127 | -rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend |
118 | 128 | ||
119 | _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_TASKS) _link.ld.in |
129 | _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_TASKS) _link.ld.in |
120 | for task in $(RD_TASKS) ; do \ |
130 | for task in $(RD_TASKS) ; do \ |
121 | cp $$task $(USPACEDIR)/dist/sbin/ ; \ |
131 | cp $$task $(USPACEDIR)/dist/sbin/ ; \ |
122 | done |
132 | done |
- | 133 | ifeq ($(RDFMT),tmpfs) |
|
123 | ../../../../tools/mktmpfs.py 16384 $(USPACEDIR)/dist/ initrd.img |
134 | ../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs |
- | 135 | endif |
|
- | 136 | ifeq ($(RDFMT),fat) |
|
- | 137 | ../../../../tools/mkfat.sh $(USPACEDIR)/dist/ initrd.fs |
|
- | 138 | endif |
|
- | 139 | ../../../../tools/mkhord.py 16384 initrd.fs initrd.img |
|
- | 140 | rm initrd.fs |
|
124 | ../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS) ./initrd.img |
141 | ../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS) |
125 | 142 | ||
126 | %.o: %.S |
143 | %.o: %.S |
127 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
144 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
128 | 145 | ||
129 | %.o: %.c |
146 | %.o: %.c |