Consolidate Linux/Windows Makefiles into one, see http://www.proxmark.org/forum/topic...
[proxmark3-svn] / armsrc / Makefile
1 # Makefile for armsrc, see ../common/Makefile.common for common settings
2 include ../common/Makefile.common
3
4 APP_INCLUDES = apps.h
5
6 # Add the "-DWITH_LCD" flag in APP_CLFAGS to add support for LCD
7 # and add OBJLCD to OBJ too
8 APP_CFLAGS = -O6
9
10 OBJLCD = $(OBJDIR)/fonts.o \
11 $(OBJDIR)/LCD.o
12
13 OBJ = $(OBJDIR)/start.o \
14 $(OBJDIR)/appmain.o \
15 $(OBJDIR)/fpga.o \
16 $(OBJDIR)/lfops.o \
17 $(OBJDIR)/iso14443.o \
18 $(OBJDIR)/iso14443a.o \
19 $(OBJDIR)/iso15693.o \
20 $(OBJDIR)/util.o \
21 $(OBJDIR)/usb.o
22
23 OBJFPGA = \
24 $(OBJDIR)/fpgaimg.o
25
26 all: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
27
28 $(OBJDIR)/fpgaimage.elf: $(OBJDIR)/fpgaimg.o
29 $(LD) -g -Tldscript-fpga -Map=$(patsubst %.elf,%.map,$@) -o $@ $^
30
31 $(OBJDIR)/osimage.elf: $(OBJ) $(OBJCOMMON) $(ARMLIB)/libgcc.a
32 $(LD) -g -Tldscript -Map=$(patsubst %.elf,%.map,$@) -o $@ $^
33
34 $(OBJDIR)/%.s19: $(OBJDIR)/%.elf
35 $(OBJCOPY) -Osrec --srec-forceS3 $^ $@
36
37 $(OBJ) $(OBJFPGA): $(OBJDIR)/%.o: %.c $(INCLUDES)
38 $(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
39
40 clean:
41 $(DELETE) $(OBJDIR)$(PATHSEP)*.o
42 $(DELETE) $(OBJDIR)$(PATHSEP)*.elf
43 $(DELETE) $(OBJDIR)$(PATHSEP)*.s19
44 $(DELETE) $(OBJDIR)$(PATHSEP)*.map
45
46 .PHONY: all clean help
47 help:
48 @echo Multi-OS Makefile, you are running on $(DETECTED_OS)
49 @echo Possible targets:
50 @echo + all - Make both:
51 @echo + osimage.s19 - The OS image
52 @echo + fpgaimage.s19 - The FPGA image
53 @echo + clean - Clean $(OBJDIR)
Impressum, Datenschutz