Skip to content

Commit

Permalink
Move loader.mk to mk/rules and rmove misleading target.mk file
Browse files Browse the repository at this point in the history
Fix #65
  • Loading branch information
georgekang committed Feb 15, 2014
1 parent da85c69 commit c901f62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,4 @@ dir-rules := mk/rules
$(foreach rule, $(shell ls $(dir-rules)), \
$(eval include $(dir-rules)/$(rule)))

include mk/target.mk
include mk/generic.mk
10 changes: 10 additions & 0 deletions mk/loader.mk → mk/rules/loader.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Copyright (c) 2013 The F9 Microkernel Project. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
ifeq "$(CONFIG_LOADER)" "y"

EXEC_FORMAT = elf32-littlearm
F9_LD_FILE = f9_sram.ld

loader-objs := $(loader-all-y)
kernel-obj := $(out)/kernel.loader.o
Expand All @@ -21,6 +23,7 @@ cmd_c_to_o_loader = $(CC) $(CFLAGS_INCLUDE_LOADER) -DLOADER $(CFLAGS) -MMD -MF $
cmd_loader_elf = $(LD) --oformat $(EXEC_FORMAT) $(loader-objs) $(kernel-obj) -o $@ -L loader -T loader.ld $(LIBGCC)

.PHONY: loader
all: loader
loader: $(out)/loader.bin
mv $(out)/loader.bin $(out)/$(PROJECT).bin

Expand All @@ -38,3 +41,10 @@ $(out)/kernel_strip.elf: $(out)/$(PROJECT).elf

$(out)/%.loader.o: %.c
$(call quiet,c_to_o_loader,CC )

else

F9_LD_FILE = f9_flash.ld
all: bare

endif

0 comments on commit c901f62

Please sign in to comment.