Makefile: output formatting changes
This commit is contained in:
parent
afba079256
commit
f9244836e1
47
Makefile
47
Makefile
@ -5,15 +5,16 @@
|
|||||||
ARCH = arm
|
ARCH = arm
|
||||||
|
|
||||||
# Config options concerning the build process itself
|
# Config options concerning the build process itself
|
||||||
VERBOSE = 0 # 1 shows all compiler flags, 0 shows cleaner output
|
VERBOSE ?= 0 # 1 shows all compiler flags, 0 shows cleaner output
|
||||||
|
V = $(if $(VERBOSE:1=),@) # Use this to prefix commands that should only be shown when VERBOSE==1
|
||||||
|
|
||||||
# Define the tools to be used
|
# Define the tools to be used
|
||||||
TOOL_PREFIX = arm-elf-
|
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
|
OBJCOPY = $(TOOL_PREFIX)objcopy
|
||||||
OBJDMP = $(TOOL_PREFIX)objdump
|
OBJDUMP = $(TOOL_PREFIX)objdump
|
||||||
|
|
||||||
# Define the flags we'll need for our tools
|
# Define the flags we'll need for our tools
|
||||||
INCLUDES = -I include
|
INCLUDES = -I include
|
||||||
@ -27,45 +28,47 @@ include boot/Makefile.inc
|
|||||||
include kernel/Makefile.inc
|
include kernel/Makefile.inc
|
||||||
include devices/Makefile.inc
|
include devices/Makefile.inc
|
||||||
|
|
||||||
.PHONY: all clean boot
|
.PHONY: all clean boot boot-gdb
|
||||||
|
|
||||||
all: aedrix-kernel.img aedrix-kernel.elf
|
all: aedrix-kernel.img aedrix-kernel.elf
|
||||||
|
|
||||||
aedrix-kernel.elf: $(KOBJS)
|
aedrix-kernel.elf: $(KOBJS)
|
||||||
$(if $(VERBOSE:1=),@echo ' LD $@')
|
@echo ' LD $@'
|
||||||
$(if $(VERBOSE:1=),@)$(LD) $(KLDFLAGS) -o $@ $(KOBJS) $(EXTRA_LIBS)
|
$(V)$(LD) $(KLDFLAGS) -o $@ $(KOBJS) $(EXTRA_LIBS)
|
||||||
|
|
||||||
aedrix-kernel.objdump: aedrix-kernel.elf
|
aedrix-kernel.objdump: aedrix-kernel.elf
|
||||||
$(if $(VERBOSE:1=),@echo ' OBJDMP $@')
|
@echo 'OBJDUMP $@'
|
||||||
$(if $(VERBOSE:1=),@)$(OBJDMP) -D $< > $@
|
$(V)$(OBJDUMP) -D $< > $@
|
||||||
|
|
||||||
aedrix-kernel.img: aedrix-kernel.elf
|
aedrix-kernel.img: aedrix-kernel.elf
|
||||||
$(if $(VERBOSE:1=),@echo ' OBJCPY $@')
|
@echo 'OBJCOPY $@'
|
||||||
$(if $(VERBOSE:1=),@)$(OBJCPY) $< -O binary $@
|
$(V)$(OBJCOPY) $< -O binary $@
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(if $(VERBOSE:1=),@echo ' CC $@')
|
@echo ' CC $@'
|
||||||
$(if $(VERBOSE:1=),@)$(CC) $(KCFLAGS) -c -o $@ $<
|
$(V)$(CC) $(KCFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
# Assembly files without preprocessor directives
|
# Assembly files without preprocessor directives
|
||||||
%.o: %.s
|
%.o: %.s
|
||||||
$(if $(VERBOSE:1=),@echo ' AS $@')
|
@echo ' AS $@'
|
||||||
$(if $(VERBOSE:1=),@)$(AS) -o $@ $<
|
$(V)$(AS) -o $@ $<
|
||||||
|
|
||||||
# Assembly files with preprocessor directives
|
# Assembly files with preprocessor directives
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
$(if $(VERBOSE:1=),@echo ' AS $@')
|
@echo ' AS $@'
|
||||||
$(if $(VERBOSE:1=),@)$(AS) -o $@ $<
|
$(V)$(AS) -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo ' CLEAN *.o'
|
@echo ' CLEAN *.o'
|
||||||
@rm -f $(KOBJS)
|
$(V)rm -f $(KOBJS)
|
||||||
@echo ' CLEAN aedrix-kernel.elf'
|
@echo ' CLEAN aedrix-kernel.elf'
|
||||||
@rm -f aedrix-kernel.elf
|
$(V)rm -f aedrix-kernel.elf
|
||||||
@echo ' CLEAN aedrix-kernel.objdump'
|
@echo ' CLEAN aedrix-kernel.objdump'
|
||||||
@rm -f aedrix-kernel.objdump
|
$(V)rm -f aedrix-kernel.objdump
|
||||||
@echo ' CLEAN aedrix-kernel.img'
|
@echo ' CLEAN aedrix-kernel.img'
|
||||||
@rm -f aedrix-kernel.img
|
$(V)rm -f aedrix-kernel.img
|
||||||
|
|
||||||
boot: aedrix-kernel.elf
|
boot: aedrix-kernel.img
|
||||||
@qemu-system-arm -m 1024 -M vexpress-a9 -kernel aedrix-kernel.elf -serial stdio
|
$(V)qemu-system-arm -m 1024 -M vexpress-a9 -kernel aedrix-kernel.img -serial stdio
|
||||||
|
boot-gdb: aedrix-kernel.img
|
||||||
|
$(V)qemu-system-arm -m 1024 -M vexpress-a9 -kernel aedrix-kernel.img -serial stdio -S -s
|
||||||
|
Loading…
Reference in New Issue
Block a user