Skip to content
Browse files

converted bare metal tests to new common makefile.

  • Loading branch information...
1 parent fb7dcba commit a4700bdecdea68a532975d00cae920c30dd21769 @balau committed Sep 4, 2011
View
13 qemu-bare-hello/Makefile
@@ -1,29 +1,30 @@
+CROSS_COMPILE=arm-none-eabi-
+include ../common/common.mk
ASFLAGS = -mcpu=arm926ej-s -g
CFLAGS = -mcpu=arm926ej-s -g
LDFLAGS = -T $*.ld
-APP = test
+APP = test
DEBUG_APP = test
-APP_TARGETS = $(addsuffix .elf, $(APP))
+APP_TARGETS = $(APP) $(APP).bin
.PHONY: all
all: $(APP_TARGETS)
-test.elf: startup.o
+test: startup.o
.PHONY: clean
clean:
rm -rf *.o
rm -rf $(APP_TARGETS)
-debug: $(DEBUG_APP).elf
- xterm -e 'qemu-system-arm -m 128M -M versatilepb -m 128M -s -nographic -S -kernel test.bin'&
+debug: $(DEBUG_APP).bin
+ xterm -e 'qemu-system-arm -m 128M -M versatilepb -m 128M -s -nographic -S -kernel $(DEBUG_APP).bin'&
ddd --debugger $(GDB) --command $(DEBUG_APP)-qemu.gdb
qemu: $(DEBUG_APP).bin
xterm -e 'qemu-system-arm -m 128M -M versatilepb -m 128M -nographic -kernel $<'
-include ../common/arm.mk
View
2 qemu-bare-hello/test-qemu.gdb
@@ -1,3 +1,3 @@
target remote localhost:1234
-file test.elf
+file test
View
21 qemu-bare-semihosting/Makefile
@@ -1,30 +1,26 @@
-CODESOURCERY_PATH = /home/francesco/CodeSourcery/Sourcery_G++_Lite/
-SCRIPTS_PATH = $(CODESOURCERY_PATH)/arm-none-eabi/lib/
-GCCLIBS_PATH = $(CODESOURCERY_PATH)/lib/gcc/arm-none-eabi/4.4.1/
-
-#COLLECTED_LDFLAGS = --sysroot=$(CODESOURCERY_PATH)bin/../arm-none-eabi -X $(CODESOURCERY_PATH)bin/../lib/gcc/arm-none-eabi/4.4.1/crti.o $(CODESOURCERY_PATH)bin/../lib/gcc/arm-none-eabi/4.4.1/crtbegin.o -L$(CODESOURCERY_PATH)bin/../lib/gcc/arm-none-eabi/4.4.1 -L$(CODESOURCERY_PATH)bin/../lib/gcc -L$(CODESOURCERY_PATH)bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib -L$(CODESOURCERY_PATH)bin/../arm-none-eabi/lib --start-group -lgcc -lc --end-group $(CODESOURCERY_PATH)bin/../lib/gcc/arm-none-eabi/4.4.1/crtend.o $(CODESOURCERY_PATH)bin/../lib/gcc/arm-none-eabi/4.4.1/crtn.o
+CROSS_COMPILE = arm-none-eabi-
+include ../common/common.mk
#ASFLAGS = -mcpu=arm926ej-s -g
#CFLAGS = -mcpu=arm926ej-s -g
-LDFLAGS = $(COLLECTED_LDFLAGS) -T qemu-hosted.ld
+LDFLAGS += -T qemu-hosted.ld
APP = main
DEBUG_APP = main
-APP_TARGETS = $(addsuffix .hd,$(APP)) $(addsuffix .code, $(APP)) $(addsuffix .elf, $(APP)) $(addsuffix .bin, $(APP))
+APP_TARGETS = $(addsuffix .hd,$(APP)) $(addsuffix .dis, $(APP)) $(addsuffix .bin, $(APP)) $(APP)
.PHONY: all clean debug run qemu
all: $(APP_TARGETS)
clean:
rm -rf *.o
- rm -rf $(addsuffix .elf, $(APP))
rm -rf $(addsuffix .map, $(APP))
rm -rf $(APP_TARGETS)
rm -rf zero1kB.bin
-debug: $(DEBUG_APP).elf
+debug: $(DEBUG_APP)
ddd --debugger $(GDB) --command $(DEBUG_APP).gdb $<
run: $(DEBUG_APP).bin
@@ -33,12 +29,9 @@ run: $(DEBUG_APP).bin
zero1kB.bin:
dd if=/dev/zero of=$@ bs=1 count=1024
-qemu: $(DEBUG_APP).elf zero1kB.bin
+qemu: $(DEBUG_APP) zero1kB.bin
xterm -e 'qemu-system-arm -semihosting -s -M versatilepb -s -nographic -S -kernel zero1kB.bin'&
ddd --debugger $(GDB) --command $(DEBUG_APP)-qemu.gdb
-include ../common/arm.mk
-
-%.elf: %.o
- $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
+main: main.c
View
13 qemu-bare-serials/Makefile
@@ -1,12 +1,14 @@
+CROSS_COMPILE = arm-none-eabi-
+include ../common/common.mk
ASFLAGS = -mcpu=arm926ej-s -g
CFLAGS = -mcpu=arm926ej-s -g
LDFLAGS = -T $*.ld
-APP = test
+APP = test
DEBUG_APP = test
-APP_TARGETS = $(addsuffix .elf, $(APP))
+APP_TARGETS = $(APP)
.PHONY: all
all: $(APP_TARGETS)
@@ -18,13 +20,12 @@ clean:
rm -rf *.o
rm -rf $(APP_TARGETS)
-debug: $(DEBUG_APP).elf
- xterm -e 'qemu-system-arm -m 128M -M versatilepb -m 128M -s -nographic -S -kernel test.bin'&
+debug: $(DEBUG_APP).bin
+ xterm -e 'qemu-system-arm -m 128M -M versatilepb -m 128M -s -nographic -S -kernel $(DEBUG_APP).bin'&
ddd --debugger $(GDB) --command $(DEBUG_APP)-qemu.gdb
run: $(DEBUG_APP).bin
qemu-system-arm -m 128M -M versatilepb -m 128M -kernel $< -serial stdio -serial telnet:localhost:1235,server -serial telnet:localhost:1236,server
-
-include ../common/arm.mk
+test: startup.o
View
2 qemu-bare-serials/test-qemu.gdb
@@ -1,3 +1,3 @@
target remote localhost:1234
-file test.elf
+file test

0 comments on commit a4700bd

Please sign in to comment.
Something went wrong with that request. Please try again.