1 ##############################################################################################
3 # !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!
5 ##############################################################################################
9 # make all = Create project
11 # make clean = Clean project files.
13 # To rebuild project do "make clean" and "make all".
16 ##############################################################################################
17 # Start of default section
23 AS
= $(TRGT
)gcc
-x assembler-with-cpp
28 # List all default C defines here, like -D_DEBUG=1
31 # List all default ASM defines here, like -D_DEBUG=1
34 # List all default directories to look for include files here
37 # List the default directory to look for the libraries here
40 # List all default libraries here
44 # End of default section
45 ##############################################################################################
47 ##############################################################################################
48 # Start of user section
51 # Define project name here
54 # Define linker script file here
55 LDSCRIPT_RAM
= .
/prj
/ethernut3_ram.
ld
57 # List all user C define here, like -D_DEBUG=1
60 # Define ASM defines here
63 # List C source files here
66 # List ASM source files here
69 # List all user directories here
72 # List the user directory to look for the libraries here
75 # List all user libraries here
78 # Define optimisation level here
83 ##############################################################################################
86 INCDIR
= $(patsubst %,-I
%,$(DINCDIR
) $(UINCDIR
))
87 LIBDIR
= $(patsubst %,-L
%,$(DLIBDIR
) $(ULIBDIR
))
88 DEFS
= $(DDEFS
) $(UDEFS
)
89 ADEFS
= $(DADEFS
) $(UADEFS
)
90 OBJS
= $(ASRC
:.s
=.o
) $(SRC
:.c
=.o
)
91 LIBS
= $(DLIBS
) $(ULIBS
)
92 MCFLAGS
= -mcpu
=$(MCU
)
94 ASFLAGS
= $(MCFLAGS
) -g
-gdwarf-2
-Wa
,-amhls
=$(<:.s
=.lst
) $(ADEFS
)
95 CPFLAGS
= $(MCFLAGS
) $(OPT
) -gdwarf-2
-mthumb-interwork
-fomit-frame-pointer
-Wall
-Wstrict-prototypes
-fverbose-asm
-Wa
,-ahlms
=$(<:.c
=.lst
) $(DEFS
)
96 LDFLAGS_RAM
= $(MCFLAGS
) -nostartfiles
-T
$(LDSCRIPT_RAM
) -Wl
,-Map
=$(PROJECT
)_ram.map
,--cref
,--no-warn-mismatch
$(LIBDIR
)
98 # Generate dependency information
99 CPFLAGS
+= -MD
-MP
-MF .dep
/$(@F
).d
107 RAM
: $(OBJS
) $(PROJECT
)_ram.elf
$(PROJECT
)_ram.hex
110 $(CC
) -c
$(CPFLAGS
) -I .
$(INCDIR
) $< -o
$@
113 $(AS
) -c
$(ASFLAGS
) $< -o
$@
116 $(CC
) $(OBJS
) $(LDFLAGS_RAM
) $(LIBS
) -o
$@
123 -rm -f
$(PROJECT
)_ram.elf
124 -rm -f
$(PROJECT
)_ram.map
125 -rm -f
$(PROJECT
)_ram.hex
126 -rm -f
$(SRC
:.c
=.c.bak
)
127 -rm -f
$(SRC
:.c
=.lst
)
128 -rm -f
$(ASRC
:.s
=.s.bak
)
129 -rm -f
$(ASRC
:.s
=.lst
)
133 # Include the dependency files, should be the last of the makefile
135 -include $(shell mkdir .dep
2>/dev
/null
) $(wildcard .dep
/*)