Preliminary support for Freescale i.MX53
[openocd/ellerodev.git] / testing / examples / STR710JtagSpeed / makefile
blob816ab233e8021f0e7cdee959b8c5bf1d996438f4
2 # !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!
4 ##############################################################################################
5 #
6 # On command line:
8 # make all = Create project
10 # make clean = Clean project files.
12 # To rebuild project do "make clean" and "make all".
15 ##############################################################################################
16 # Start of default section
19 TRGT = arm-elf-
20 CC = $(TRGT)gcc
21 CP = $(TRGT)objcopy
22 AS = $(TRGT)gcc -x assembler-with-cpp
23 BIN = $(CP) -O ihex
25 MCU = arm7tdmi
27 # List all default C defines here, like -D_DEBUG=1
28 DDEFS =
30 # List all default ASM defines here, like -D_DEBUG=1
31 DADEFS =
33 # List all default directories to look for include files here
34 DINCDIR =
36 # List the default directory to look for the libraries here
37 DLIBDIR =
39 # List all default libraries here
40 DLIBS =
43 # End of default section
44 ##############################################################################################
46 ##############################################################################################
47 # Start of user section
50 # Define project name here
51 PROJECT = test
53 # Define linker script file here
54 LDSCRIPT= ./prj/str7_ram.ld
56 # List all user C define here, like -D_DEBUG=1
57 UDEFS =
59 # Define ASM defines here
60 UADEFS =
62 # List C source files here
63 SRC = ./src/main.c
65 # List ASM source files here
66 ASRC = ./src/crt.s
68 # List all user directories here
69 UINCDIR = ./inc
71 # List the user directory to look for the libraries here
72 ULIBDIR =
74 # List all user libraries here
75 ULIBS =
77 # Define optimisation level here
78 OPT = -O0
81 # End of user defines
82 ##############################################################################################
85 INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
86 LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
87 DEFS = $(DDEFS) $(UDEFS)
88 ADEFS = $(DADEFS) $(UADEFS)
89 OBJS = $(ASRC:.s=.o) $(SRC:.c=.o)
90 LIBS = $(DLIBS) $(ULIBS)
91 MCFLAGS = -mcpu=$(MCU)
93 ASFLAGS = $(MCFLAGS) -g -gdwarf-2 -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
94 CPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
95 LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
97 # Generate dependency information
98 CPFLAGS += -MD -MP -MF .dep/$(@F).d
101 # makefile rules
104 all: $(OBJS) $(PROJECT).elf $(PROJECT).hex
106 %o : %c
107 $(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@
109 %o : %s
110 $(AS) -c $(ASFLAGS) $< -o $@
112 %elf: $(OBJS)
113 $(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
115 %hex: %elf
116 $(BIN) $< $@
118 clean:
119 -rm -f $(OBJS)
120 -rm -f $(PROJECT).elf
121 -rm -f $(PROJECT).map
122 -rm -f $(PROJECT).hex
123 -rm -f $(SRC:.c=.c.bak)
124 -rm -f $(SRC:.c=.lst)
125 -rm -f $(ASRC:.s=.s.bak)
126 -rm -f $(ASRC:.s=.lst)
127 -rm -fR .dep
130 # Include the dependency files, should be the last of the makefile
132 -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
134 # *** EOF ***