mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-21 13:53:26 -07:00
Consolidate Linux/Windows Makefiles into one, see http://www.proxmark.org/forum/topic/312/consolidating-makefile/
+ Needs GNU make for Windows, a new release of the Windows development environment will follow + Is based on the Windows Makefile, so will build everything in Thumb mode, doesn't have flash commands (yet)
This commit is contained in:
parent
5435eb0ca2
commit
7e931bbd32
5 changed files with 103 additions and 250 deletions
|
@ -1,19 +1,11 @@
|
|||
PATH=..\..\devkitARM\bin;%PATH%
|
||||
CC = arm-elf-gcc
|
||||
AS = arm-elf-as
|
||||
LD = arm-elf-ld
|
||||
OBJCOPY = arm-elf-objcopy
|
||||
# Makefile for armsrc, see ../common/Makefile.common for common settings
|
||||
include ../common/Makefile.common
|
||||
|
||||
OBJDIR = obj
|
||||
APP_INCLUDES = apps.h
|
||||
|
||||
INCLUDE = -I../include
|
||||
|
||||
INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
|
||||
LIB = "..\..\devkitARM\lib\gcc\arm-elf\4.1.0\interwork"
|
||||
|
||||
# Add the "-DWITH_LCD" flag in CLFAGS to add support for LCD
|
||||
# Add the "-DWITH_LCD" flag in APP_CLFAGS to add support for LCD
|
||||
# and add OBJLCD to OBJ too
|
||||
CFLAGS = -O6 -c $(INCLUDE) -Wall
|
||||
APP_CFLAGS = -O6
|
||||
|
||||
OBJLCD = $(OBJDIR)/fonts.o \
|
||||
$(OBJDIR)/LCD.o
|
||||
|
@ -25,42 +17,37 @@ OBJ = $(OBJDIR)/start.o \
|
|||
$(OBJDIR)/iso14443.o \
|
||||
$(OBJDIR)/iso14443a.o \
|
||||
$(OBJDIR)/iso15693.o \
|
||||
$(OBJDIR)/util.o
|
||||
$(OBJDIR)/util.o \
|
||||
$(OBJDIR)/usb.o
|
||||
|
||||
OBJFPGA = \
|
||||
$(OBJDIR)/fpgaimg.o
|
||||
|
||||
OBJCOMMON = \
|
||||
$(OBJDIR)/usb.o
|
||||
all: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
|
||||
|
||||
all: osimage.s19
|
||||
$(OBJDIR)/fpgaimage.elf: $(OBJDIR)/fpgaimg.o
|
||||
$(LD) -g -Tldscript-fpga -Map=$(patsubst %.elf,%.map,$@) -o $@ $^
|
||||
|
||||
$(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o
|
||||
@echo obj/fpgaimage.s19
|
||||
@$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf -Map=obj/fpgaimage.map $(OBJDIR)/fpgaimg.o
|
||||
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19
|
||||
$(OBJDIR)/osimage.elf: $(OBJ) $(OBJCOMMON) $(ARMLIB)/libgcc.a
|
||||
$(LD) -g -Tldscript -Map=$(patsubst %.elf,%.map,$@) -o $@ $^
|
||||
|
||||
$(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)
|
||||
@echo obj/osimage.s19
|
||||
@$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) -Map=obj/osimage.map $(LIB)\libgcc.a
|
||||
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19
|
||||
$(OBJDIR)/%.s19: $(OBJDIR)/%.elf
|
||||
$(OBJCOPY) -Osrec --srec-forceS3 $^ $@
|
||||
|
||||
osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
|
||||
@echo osimage.s19
|
||||
|
||||
$(OBJ): $(@B).c $(INCLUDES)
|
||||
@echo $(@B).c
|
||||
@$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
|
||||
|
||||
$(OBJCOMMON): ../common/$(@B).c $(INCLUDES)
|
||||
@echo $(@B).c
|
||||
@$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/$(@B).c -o $(OBJDIR)/$(@B).o
|
||||
|
||||
$(OBJFPGA): $(@B).c $(INCLUDES)
|
||||
@echo $(@B).c
|
||||
@$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
|
||||
$(OBJ) $(OBJFPGA): $(OBJDIR)/%.o: %.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
|
||||
|
||||
clean:
|
||||
del /q obj\*.o
|
||||
del /q obj\*.elf
|
||||
del /q obj\*.s19
|
||||
$(DELETE) $(OBJDIR)$(PATHSEP)*.o
|
||||
$(DELETE) $(OBJDIR)$(PATHSEP)*.elf
|
||||
$(DELETE) $(OBJDIR)$(PATHSEP)*.s19
|
||||
$(DELETE) $(OBJDIR)$(PATHSEP)*.map
|
||||
|
||||
.PHONY: all clean help
|
||||
help:
|
||||
@echo Multi-OS Makefile, you are running on $(DETECTED_OS)
|
||||
@echo Possible targets:
|
||||
@echo + all - Make both:
|
||||
@echo + osimage.s19 - The OS image
|
||||
@echo + fpgaimage.s19 - The FPGA image
|
||||
@echo + clean - Clean $(OBJDIR)
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
# This makefile needs to be edited to reflect the location
|
||||
# of your own arm-elf-gcc toolchain (ARMLIB variable)
|
||||
|
||||
CC = arm-elf-gcc
|
||||
AS = arm-elf-as
|
||||
LD = arm-elf-ld
|
||||
OBJCOPY = arm-elf-objcopy
|
||||
|
||||
# Indicate where your gnuarm toolchain libgcc.a interworking library is located
|
||||
# or set $ARMLIB in your environment:
|
||||
#ARMLIB = /usr/local/lib/gcc/arm-elf/4.3.3/interwork
|
||||
|
||||
|
||||
# Add -DWITH_LCD to EXTRA_CFLAGS if you want support for LCD
|
||||
# in your firmware (add OBJLCD to OBJ too!)
|
||||
#EXTRA_CFLAGS = -DWITH_LCD
|
||||
EXTRA_CFLAGS =
|
||||
|
||||
### You should not need to edit below this line
|
||||
|
||||
INCLUDE = -I../include
|
||||
INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
|
||||
CFLAGS_COMMON = -O6 -c $(INCLUDE) -Wall -mthumb-interwork
|
||||
CFLAGS = $(CFLAGS_COMMON) $(EXTRA_CFLAGS) -mthumb
|
||||
|
||||
|
||||
OBJDIR = obj
|
||||
|
||||
OBJLCD = $(OBJDIR)/LCD.o\
|
||||
$(OBJDIR)/fonts.o
|
||||
|
||||
OBJ = $(OBJDIR)/start.o \
|
||||
$(OBJDIR)/appmain.o \
|
||||
$(OBJDIR)/fpga.o \
|
||||
$(OBJDIR)/lfops.o \
|
||||
$(OBJDIR)/iso15693.o \
|
||||
$(OBJDIR)/util.o
|
||||
|
||||
# To be compiled in ARM mode, not thumb mode: larger but faster
|
||||
# Alleviates the 'blew circular buffer' issues somehow...
|
||||
OBJFAST = $(OBJDIR)/iso14443.o \
|
||||
$(OBJDIR)/iso14443a.o
|
||||
|
||||
OBJFPGA = $(OBJDIR)/fpgaimg.o
|
||||
|
||||
OBJCOMMON = $(OBJDIR)/usb.o
|
||||
|
||||
all: osimage.s19 fpgaimage.s19 fullimage.s19
|
||||
|
||||
fpgaimage.s19: $(OBJFPGA)
|
||||
@echo fpgaimage.s19
|
||||
$(LD) -g -Tldscript-fpga -o $(OBJDIR)/fpgaimage.elf $^
|
||||
$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/fpgaimage.elf fpgaimage.s19
|
||||
|
||||
osimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON)
|
||||
@echo osimage.s19
|
||||
$(LD) -g -Tldscript -o $(OBJDIR)/osimage.elf -Map=osimage.map $^ $(ARMLIB)/libgcc.a
|
||||
$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/osimage.elf osimage.s19
|
||||
|
||||
fullimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON) $(OBJFAST) $(OBJFPGA)
|
||||
@echo fullimage.s19
|
||||
$(LD) -g -Tldscript-full -o $(OBJDIR)/fullimage.elf $^ $(ARMLIB)/libgcc.a
|
||||
$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/fullimage.elf fullimage.s19
|
||||
|
||||
# Directives to put the *.o in the OBJDIR directory:
|
||||
$(OBJ): $(OBJDIR)/%.o : %.c
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
$(OBJFPGA): $(OBJDIR)/%.o : %.c
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
$(OBJFAST): $(OBJDIR)/%.o : %.c
|
||||
$(CC) $(CFLAGS_COMMON) $< -o $@
|
||||
|
||||
$(OBJCOMMON): $(OBJDIR)/%.o : ../common/%.c
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
flash-both: flash flash-fpga
|
||||
|
||||
flash-fpga: fpgaimage.s19
|
||||
../linux/flasher fpga fpgaimage.s19
|
||||
|
||||
flash: osimage.s19
|
||||
../linux/flasher os osimage.s19
|
||||
|
||||
# Those do not work on the current firmware !
|
||||
jtag-flash-full: fullimage.s19
|
||||
../../OpenOCD/openocd -c "halt; flash write_image fullimage.s19 0x00100000; halt; reset; resume; poll; exit"
|
||||
|
||||
jtag-flash-fpga: fpgaimage.s19
|
||||
../../OpenOCD/openocd -c "halt; flash write_image fpgaimage.s19 0x00100000; halt; reset; resume; poll; exit"
|
||||
|
||||
jtag-flash: osimage.s19
|
||||
../../OpenOCD/openocd -c "halt; flash write_image osimage.s19 0x00100000; halt; reset; resume; poll; exit"
|
||||
|
||||
clean:
|
||||
rm -f $(OBJDIR)/*.o $(OBJDIR)/*.elf *.s19 osimage.map
|
||||
|
||||
.PHONY: all clean
|
Loading…
Add table
Add a link
Reference in a new issue