forked from paparazzi/paparazzi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.arm-embedded-common
62 lines (53 loc) · 1.43 KB
/
Makefile.arm-embedded-common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Hey Emacs, this is a -*- makefile -*-
#
# Copyright (C) 2012 Felix Ruess <felix.ruess@gmail.com>
#
# This has some common targets
# for bare metal systems like on the ARM7TDMI, cortex M3/4
ifdef CC
CC_VERSION := $(shell $(CC) --version | head -1)
else
CC_VERSION := Not found
endif
printcommands:
@echo ""
@echo "GCC version: $(CC_VERSION)" '\n'
# @echo "Using CC = $(CC)"
# @echo "Using LD = $(LD)"
# @echo "Using CP = $(CP)"
# @echo "Using DMP = $(DMP)"
# @echo "Using NM = $(NM)"
# @echo "Using SIZE = $(SIZE)"
# @echo ""
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(OBJDIR)/$(TARGET).hex
ELFSIZE = $(SIZE) -A -x $(OBJDIR)/$(TARGET).elf
sizebefore:
@if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; echo "Previous size:"; $(ELFSIZE); fi
sizeafter:
@if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; echo "Current size:"; $(ELFSIZE); fi
# Target: clean project.
clean: clean_list
clean_list :
@echo
$(RM) $(OBJDIR)/$(TARGET).hex
$(RM) $(OBJDIR)/$(TARGET).obj
$(RM) $(OBJDIR)/$(TARGET).elf
$(RM) $(OBJDIR)/$(TARGET).map
$(RM) $(OBJDIR)/$(TARGET).obj
$(RM) $(OBJDIR)/$(TARGET).a90
$(RM) $(OBJDIR)/$(TARGET).sym
$(RM) $(OBJDIR)/$(TARGET).lnk
$(RM) $(OBJDIR)/$(TARGET).lss
$(RM) $(COBJ)
$(RM) $(AOBJ)
$(RM) $(COBJARM)
$(RM) $(AOBJARM)
$(RM) $(LST)
$(RM) $(SRC:.c=.s)
$(RM) $(SRC:.c=.d)
$(RM) $(SRCARM:.c=.s)
$(RM) $(SRCARM:.c=.d)
$(RM) .dep/*
$(RM) *~
.PHONY : printcommands sizebefore sizeafter clean clean_list