2010-02-21 08:12:52 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
|
|
|
# at your option, any later version. See the LICENSE.txt file for the text of
|
|
|
|
# the license.
|
|
|
|
#-----------------------------------------------------------------------------
|
2010-02-21 05:24:25 +08:00
|
|
|
# Makefile for armsrc, see ../common/Makefile.common for common settings
|
2010-02-21 08:12:52 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2010-02-21 05:24:25 +08:00
|
|
|
|
|
|
|
APP_INCLUDES = apps.h
|
|
|
|
|
|
|
|
#remove one of the following defines and comment out the relevant line
|
|
|
|
#in the next section to remove that particular feature from compilation
|
2015-03-31 14:01:23 +08:00
|
|
|
APP_CFLAGS = -DWITH_LF -DWITH_ISO15693 -DWITH_ISO14443a -DWITH_ISO14443b -DWITH_ICLASS -DWITH_LEGICRF -DWITH_HITAG -DWITH_CRC -DON_DEVICE -fno-strict-aliasing -ffunction-sections -fdata-sections
|
2010-02-21 05:24:25 +08:00
|
|
|
#-DWITH_LCD
|
|
|
|
|
|
|
|
#SRC_LCD = fonts.c LCD.c
|
2015-01-31 06:03:44 +08:00
|
|
|
SRC_LF = lfops.c hitag2.c lfsampling.c
|
2015-02-19 03:02:44 +08:00
|
|
|
SRC_ISO15693 = iso15693.c iso15693tools.c
|
2012-08-29 05:39:50 +08:00
|
|
|
SRC_ISO14443a = epa.c iso14443a.c mifareutil.c mifarecmd.c mifaresniff.c
|
2010-02-21 05:24:25 +08:00
|
|
|
SRC_ISO14443b = iso14443.c
|
2015-01-14 06:18:04 +08:00
|
|
|
SRC_CRAPTO1 = crapto1.c crypto1.c des.c aes.c
|
|
|
|
SRC_CRC = iso14443crc.c crc.c crc16.c crc32.c
|
2010-02-21 05:24:25 +08:00
|
|
|
|
|
|
|
THUMBSRC = start.c \
|
|
|
|
$(SRC_LCD) \
|
|
|
|
$(SRC_ISO15693) \
|
|
|
|
$(SRC_LF) \
|
2015-01-05 22:51:27 +08:00
|
|
|
appmain.c \
|
|
|
|
printf.c \
|
2010-02-21 05:24:25 +08:00
|
|
|
util.c \
|
2010-02-21 08:10:28 +08:00
|
|
|
string.c \
|
2012-12-05 07:39:18 +08:00
|
|
|
usb_cdc.c \
|
|
|
|
cmd.c
|
2010-02-21 05:24:25 +08:00
|
|
|
|
|
|
|
# These are to be compiled in ARM mode
|
|
|
|
ARMSRC = fpgaloader.c \
|
|
|
|
legicrf.c \
|
2014-12-29 09:33:32 +08:00
|
|
|
lfdemod.c \
|
2010-02-21 05:24:25 +08:00
|
|
|
$(SRC_ISO14443a) \
|
|
|
|
$(SRC_ISO14443b) \
|
2011-05-26 20:55:15 +08:00
|
|
|
$(SRC_CRAPTO1) \
|
2015-01-14 06:18:04 +08:00
|
|
|
$(SRC_CRC) \
|
2010-10-19 22:25:17 +08:00
|
|
|
legic_prng.c \
|
2011-05-18 20:33:32 +08:00
|
|
|
iclass.c \
|
2015-01-16 18:00:17 +08:00
|
|
|
BigBuf.c \
|
2015-02-27 03:35:35 +08:00
|
|
|
optimized_cipher.c
|
2010-02-21 05:24:25 +08:00
|
|
|
|
|
|
|
# stdint.h provided locally until GCC 4.5 becomes C99 compliant
|
|
|
|
APP_CFLAGS += -I.
|
|
|
|
|
|
|
|
# Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC
|
|
|
|
include ../common/Makefile.common
|
|
|
|
|
2015-03-31 14:01:23 +08:00
|
|
|
OBJS = $(OBJDIR)/osimage.s19
|
|
|
|
#$(OBJDIR)/fpgaimage.s19
|
2010-05-09 20:17:42 +08:00
|
|
|
|
|
|
|
all: $(OBJS)
|
2010-02-21 05:24:25 +08:00
|
|
|
|
2014-06-20 07:02:59 +08:00
|
|
|
$(OBJDIR)/fpga_lf.o: fpga_lf.bit
|
|
|
|
$(OBJCOPY) -O elf32-littlearm -I binary -B arm --redefine-sym _binary____fpga_fpga_lf_bit_start=_binary_fpga_lf_bit_start --redefine-sym _binary____fpga_fpga_lf_bit_end=_binary_fpga_lf_bit_end --prefix-sections=fpga_lf_bit $^ $@
|
2010-02-21 05:24:25 +08:00
|
|
|
|
2014-06-20 07:02:59 +08:00
|
|
|
$(OBJDIR)/fpga_hf.o: fpga_hf.bit
|
|
|
|
$(OBJCOPY) -O elf32-littlearm -I binary -B arm --redefine-sym _binary____fpga_fpga_hf_bit_start=_binary_fpga_hf_bit_start --redefine-sym _binary____fpga_fpga_hf_bit_end=_binary_fpga_hf_bit_end --prefix-sections=fpga_hf_bit $^ $@
|
|
|
|
|
|
|
|
$(OBJDIR)/fullimage.elf: $(VERSIONOBJ) $(OBJDIR)/fpga_lf.o $(OBJDIR)/fpga_hf.o $(THUMBOBJ) $(ARMOBJ)
|
2010-02-26 22:03:03 +08:00
|
|
|
$(CC) $(LDFLAGS) -Wl,-T,ldscript,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
|
2010-02-21 05:24:25 +08:00
|
|
|
|
2015-03-31 14:01:23 +08:00
|
|
|
#$(OBJDIR)/fpgaimage.elf: $(OBJDIR)/fullimage.elf
|
|
|
|
# $(OBJCOPY) -F elf32-littlearm --only-section .fpgaimage $^ $@
|
2010-02-21 05:24:25 +08:00
|
|
|
|
|
|
|
$(OBJDIR)/osimage.elf: $(OBJDIR)/fullimage.elf
|
2015-03-31 14:01:23 +08:00
|
|
|
$(OBJCOPY) -F elf32-littlearm $^ $@
|
2010-02-21 05:24:25 +08:00
|
|
|
|
2010-05-09 20:17:42 +08:00
|
|
|
tarbin: $(OBJS)
|
|
|
|
$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(OBJS:%=armsrc/%) $(OBJS:%.s19=armsrc/%.elf)
|
|
|
|
|
|
|
|
|
2010-02-21 05:24:25 +08:00
|
|
|
clean:
|
|
|
|
$(DELETE) $(OBJDIR)$(PATHSEP)*.o
|
|
|
|
$(DELETE) $(OBJDIR)$(PATHSEP)*.elf
|
|
|
|
$(DELETE) $(OBJDIR)$(PATHSEP)*.s19
|
|
|
|
$(DELETE) $(OBJDIR)$(PATHSEP)*.map
|
|
|
|
$(DELETE) $(OBJDIR)$(PATHSEP)*.d
|
|
|
|
$(DELETE) version.c
|
|
|
|
|
|
|
|
.PHONY: all clean help
|
|
|
|
help:
|
|
|
|
@echo Multi-OS Makefile, you are running on $(DETECTED_OS)
|
|
|
|
@echo Possible targets:
|
|
|
|
@echo + all - Make both:
|
|
|
|
@echo + $(OBJDIR)/osimage.s19 - The OS image
|
|
|
|
@echo + $(OBJDIR)/fpgaimage.s19 - The FPGA image
|
|
|
|
@echo + clean - Clean $(OBJDIR)
|
|
|
|
|