Add aedrix-kernel.img to Makefile and update .gitignore
This commit is contained in:
parent
563ad96efb
commit
2bd44726e4
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
aedrix-kernel
|
aedrix-kernel.elf
|
||||||
|
aedrix-kernel.img
|
||||||
*.o
|
*.o
|
||||||
*.swp
|
*.swp
|
||||||
|
25
Makefile
25
Makefile
@ -12,27 +12,30 @@ TOOL_PREFIX = arm-elf-
|
|||||||
AS = $(TOOL_PREFIX)as
|
AS = $(TOOL_PREFIX)as
|
||||||
CC = $(TOOL_PREFIX)gcc
|
CC = $(TOOL_PREFIX)gcc
|
||||||
LD = $(TOOL_PREFIX)ld
|
LD = $(TOOL_PREFIX)ld
|
||||||
|
OBJCPY = $(TOOL_PREFIX)objcopy
|
||||||
|
|
||||||
# Define the flags we'll need for our tools
|
# Define the flags we'll need for our tools
|
||||||
INCLUDES = -I include
|
INCLUDES = -I include
|
||||||
KCFLAGS = -Wall -Wextra -Werror -nostdlib -nostartfiles -fno-builtin -std=gnu99 $(INCLUDES)
|
KCFLAGS = -g -Wall -Wextra -Werror -nostdlib -nostartfiles -fno-builtin -std=gnu99 $(INCLUDES)
|
||||||
KLDFLAGS = -T link.ld -L /usr/lib/gcc/arm-elf/4.7.0/
|
KLDFLAGS = -T link.ld -L /usr/lib/gcc/arm-elf/4.7.0/
|
||||||
EXTRA_LIBS = -lgcc
|
EXTRA_LIBS = -lgcc
|
||||||
|
|
||||||
KOBJS =
|
KOBJS =
|
||||||
|
|
||||||
include boot/Makefile.inc
|
include boot/Makefile.inc
|
||||||
include kernel/Makefile.inc
|
include kernel/Makefile.inc
|
||||||
include devices/Makefile.inc
|
include devices/Makefile.inc
|
||||||
|
|
||||||
all: aedrix-kernel
|
all: aedrix-kernel.img aedrix-kernel.elf
|
||||||
#all:
|
|
||||||
# @echo $(KOBJS)
|
|
||||||
|
|
||||||
aedrix-kernel: $(KOBJS)
|
aedrix-kernel.elf: $(KOBJS)
|
||||||
$(if $(VERBOSE:1=),@echo ' LD $@')
|
$(if $(VERBOSE:1=),@echo ' LD $@')
|
||||||
$(if $(VERBOSE:1=),@)$(LD) $(KLDFLAGS) -o $@ $(KOBJS) $(EXTRA_LIBS)
|
$(if $(VERBOSE:1=),@)$(LD) $(KLDFLAGS) -o $@ $(KOBJS) $(EXTRA_LIBS)
|
||||||
|
|
||||||
|
aedrix-kernel.img: aedrix-kernel.elf
|
||||||
|
$(if $(VERBOSE:1=),@echo ' OBJCPY $@')
|
||||||
|
$(if $(VERBOSE:1=),@)$(OBJCPY) $< -O binary $@
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(if $(VERBOSE:1=),@echo ' CC $@')
|
$(if $(VERBOSE:1=),@echo ' CC $@')
|
||||||
$(if $(VERBOSE:1=),@)$(CC) $(KCFLAGS) -c -o $@ $<
|
$(if $(VERBOSE:1=),@)$(CC) $(KCFLAGS) -c -o $@ $<
|
||||||
@ -51,9 +54,11 @@ aedrix-kernel: $(KOBJS)
|
|||||||
clean:
|
clean:
|
||||||
@echo ' CLEAN *.o'
|
@echo ' CLEAN *.o'
|
||||||
@rm -f $(KOBJS)
|
@rm -f $(KOBJS)
|
||||||
@echo ' CLEAN aedrix-kernel'
|
@echo ' CLEAN aedrix-kernel.elf'
|
||||||
@rm -f aedrix-kernel
|
@rm -f aedrix-kernel.elf
|
||||||
|
@echo ' CLEAN aedrix-kernel.img'
|
||||||
|
@rm -f aedrix-kernel.img
|
||||||
|
|
||||||
.PHONY: boot
|
.PHONY: boot
|
||||||
boot: aedrix-kernel
|
boot: aedrix-kernel.elf
|
||||||
@qemu-system-arm -m 1024 -M vexpress-a9 -kernel aedrix-kernel -serial stdio
|
@qemu-system-arm -m 1024 -M vexpress-a9 -kernel aedrix-kernel.elf -serial stdio
|
||||||
|
Loading…
Reference in New Issue
Block a user