2009-07-02 09:29:48 +08:00
|
|
|
PATH=..\..\devkitARM\bin;%PATH%
|
2009-04-09 14:43:20 +08:00
|
|
|
CC = arm-elf-gcc
|
|
|
|
AS = arm-elf-as
|
|
|
|
LD = arm-elf-ld
|
|
|
|
OBJCOPY = arm-elf-objcopy
|
|
|
|
|
|
|
|
OBJDIR = obj
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
2009-04-26 05:19:59 +08:00
|
|
|
# Add the "-DWITH_LCD" flag in CLFAGS to add support for LCD
|
|
|
|
# and add OBJLCD to OBJ too
|
2009-04-09 14:43:20 +08:00
|
|
|
CFLAGS = -O6 -c $(INCLUDE) -Wall
|
|
|
|
|
2009-04-26 05:19:59 +08:00
|
|
|
OBJLCD = $(OBJDIR)/fonts.o \
|
|
|
|
$(OBJDIR)/LCD.o
|
|
|
|
|
2009-04-09 14:43:20 +08:00
|
|
|
OBJ = $(OBJDIR)/start.o \
|
|
|
|
$(OBJDIR)/appmain.o \
|
|
|
|
$(OBJDIR)/fpga.o \
|
2009-07-25 19:47:43 +08:00
|
|
|
$(OBJDIR)/lfops.o \
|
2009-04-09 14:43:20 +08:00
|
|
|
$(OBJDIR)/iso14443.o \
|
|
|
|
$(OBJDIR)/iso14443a.o \
|
|
|
|
$(OBJDIR)/iso15693.o \
|
2009-04-26 05:19:59 +08:00
|
|
|
$(OBJDIR)/util.o
|
2009-04-09 14:43:20 +08:00
|
|
|
|
|
|
|
OBJFPGA = \
|
|
|
|
$(OBJDIR)/fpgaimg.o
|
|
|
|
|
|
|
|
OBJCOMMON = \
|
|
|
|
$(OBJDIR)/usb.o
|
|
|
|
|
|
|
|
all: osimage.s19
|
|
|
|
|
|
|
|
$(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o
|
|
|
|
@echo obj/fpgaimage.s19
|
2009-07-29 21:37:09 +08:00
|
|
|
@$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf -Map=obj/fpgaimage.map $(OBJDIR)/fpgaimg.o
|
2009-04-09 14:43:20 +08:00
|
|
|
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19
|
|
|
|
|
|
|
|
$(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)
|
|
|
|
@echo obj/osimage.s19
|
2009-07-29 21:37:09 +08:00
|
|
|
@$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) -Map=obj/osimage.map $(LIB)\libgcc.a
|
2009-04-09 14:43:20 +08:00
|
|
|
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
clean:
|
|
|
|
del /q obj\*.o
|
|
|
|
del /q obj\*.elf
|
|
|
|
del /q obj\*.s19
|