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