From db335b3de0cbe71cabe37931aa085cffa0032239 Mon Sep 17 00:00:00 2001 From: "henryk@ploetzli.ch" Date: Sun, 30 Aug 2009 22:35:12 +0000 Subject: [PATCH 1/1] Make objcopy call less verbose Add master Makefile --- Makefile | 20 ++++++++++++++++++++ common/Makefile.common | 14 ++++++-------- fpga/Makefile | 8 ++++---- winsrc/Makefile | 4 +++- 4 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..2c95cc14 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +include common/Makefile.common + +ifeq ($(DETECTED_OS),Linux) +HOST_BINARY=linux +else +HOST_BINARY=winsrc +endif + +all clean: %: + $(MAKE) -C bootrom $@ + $(MAKE) -C armsrc $@ + $(MAKE) -C $(HOST_BINARY) $@ + +.PHONY: all clean help +help: + @echo Multi-OS Makefile, you are running on $(DETECTED_OS) + @echo Possible targets: + @echo + all - Make bootrom, armsrc and the OS-specific host directory + @echo + clean - Clean in bootrom, armsrc and the OS-specific host directory + \ No newline at end of file diff --git a/common/Makefile.common b/common/Makefile.common index 901ce2e1..bba99ecd 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -14,7 +14,7 @@ all: # Windows yields literal "", on Linux yields an empty line ifeq ($(shell echo ""),) -# This is properly a proper system, so we can use uname +# This is probably a proper system, so we can use uname UNAME := $(shell uname) ifeq ($(UNAME), Linux) # Linux. (Todo: Add MacOS X if appropriate) @@ -73,15 +73,13 @@ $(VERSIONOBJ): $(OBJDIR)/%.o: %.c $(INCLUDES) $(CC) $(CFLAGS) -mthumb -mthumb-interwork -o $@ $< # This objcopy call translates physical flash addresses to logical addresses +# without touching start address or RAM addresses (.bss and .data sections) # See ldscript.common. -- Henryk Plötz 2009-08-27 $(OBJDIR)/%.s19: $(OBJDIR)/%.elf - $(OBJCOPY) -Osrec --srec-forceS3 --no-change-warnings \ - --change-section-address .bootphase1-0x100000 \ - --change-section-address .bootphase2-0x100000 \ - --change-section-address .fpgaimage-0x100000 \ - --change-section-address .start-0x100000 \ - --change-section-address .text-0x100000 \ - --change-section-address .rodata-0x100000 $^ $@ + $(OBJCOPY) -Osrec --srec-forceS3 --strip-debug --no-change-warnings \ + --change-addresses -0x100000 --change-start 0 \ + --change-section-address .bss+0 \ + --change-section-address .data+0 $^ $@ # version.c should be remade on every compilation .PHONY: version.c diff --git a/fpga/Makefile b/fpga/Makefile index 84155b4c..d598c8de 100644 --- a/fpga/Makefile +++ b/fpga/Makefile @@ -3,7 +3,7 @@ include ../common/Makefile.common all: fpga.ngc fpga.ngd fpga.ncd fpga-placed.ncd fpga.bit clean: $(DELETE) fpga.bgn fpga.drc fpga.ncd fpga.ngd fpga_par.xrpt fpga-placed.pad fpga-placed.par fpga-placed.xpi fpga_usage.xml xlnx_auto_0.ise xst.srp - $(DELETE) fpga.bit fpga.map fpga.ngc fpga_ngdbuild.xrpt fpga.pcf fpga-placed_pad.csv fpga-placed.ptwx fpga.rbt xlnx_auto_0_xdb + $(DELETE) fpga.map fpga.ngc fpga_ngdbuild.xrpt fpga.pcf fpga-placed_pad.csv fpga-placed.ptwx fpga.rbt xlnx_auto_0_xdb $(DELETE) fpga.bld fpga.mrp fpga.ngc_xst.xrpt fpga.ngm fpga-placed.ncd fpga-placed_pad.txt fpga-placed.unroutes fpga_summary.xml netlist.lst xst fpga.ngc: fpga.v fpga.ucf xst.scr util.v lo_simulate.v lo_read.v lo_passthru.v hi_simulate.v hi_read_tx.v hi_read_rx_xcorr.v hi_iso14443a.v @@ -31,6 +31,6 @@ fpga.bit: fpga-placed.ncd help: @echo Multi-OS Makefile, you are running on $(DETECTED_OS) @echo Possible targets: - @echo + all - Make fpga.bti, the FPGA bitstream - @echo + clean - Clean intermediate files - \ No newline at end of file + @echo + all - Make fpga.bit, the FPGA bitstream + @echo + clean - Clean intermediate files, does not clean fpga.bit + diff --git a/winsrc/Makefile b/winsrc/Makefile index 637fa319..71dce866 100644 --- a/winsrc/Makefile +++ b/winsrc/Makefile @@ -16,7 +16,9 @@ LIBS = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.li HEADERS = prox.h -all: $(OBJDIR)/prox.exe +all: prox.exe + +prox.exe: $(OBJDIR)/prox.exe copy $(OBJDIR)\prox.exe . clean: -- 2.39.5