summaryrefslogtreecommitdiff
path: root/controller/fw/Makefile
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-13 11:48:43 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-13 11:48:43 +0100
commitedde28594fbbf44a25f0fb4229353137bca35a3e (patch)
tree7cfa2f7e94957df2afc829bc7d1232205f0c3ad3 /controller/fw/Makefile
parentbf7e8701c7214d114406d4387cda1d24d2797bce (diff)
downloadmaster-thesis-edde28594fbbf44a25f0fb4229353137bca35a3e.tar.gz
master-thesis-edde28594fbbf44a25f0fb4229353137bca35a3e.tar.bz2
master-thesis-edde28594fbbf44a25f0fb4229353137bca35a3e.zip
prettify linkmem
Diffstat (limited to 'controller/fw/Makefile')
-rw-r--r--controller/fw/Makefile42
1 files changed, 23 insertions, 19 deletions
diff --git a/controller/fw/Makefile b/controller/fw/Makefile
index 27fd9ba..db10868 100644
--- a/controller/fw/Makefile
+++ b/controller/fw/Makefile
@@ -156,11 +156,21 @@ CXXFLAGS += -Wall -Wextra -Wshadow -Wundef -Wredundant-decls
CXXFLAGS += -I.
LDFLAGS += $(ARCH_FLAGS) $(SYSTEM_FLAGS)
-LDFLAGS += -Wl,--cre
-LDFLAGS += --trace
LIBS += -lgcc
-LDFLAGS += -Wl,--gc-sections -Wl,--trace-symbol=twiddleCoef_4096 -Wl,--trace-symbol=arm_cfft_sR_f32_len4096
+LDFLAGS += -Wl,--gc-sections
+
+OBJS := $(addprefix $(BUILDDIR)/,$(C_SOURCES:.c=.o) $(CXX_SOURCES:.cpp=.o))
+
+ALL_OBJS := $(OBJS)
+ALL_OBJS += $(BUILDDIR)/src/startup_stm32f407xx.o
+ALL_OBJS += $(BUILDDIR)/src/system_stm32f4xx.o
+ALL_OBJS += $(BUILDDIR)/libsodium/src/libsodium/.libs/libsodium.a
+ALL_OBJS += $(BUILDDIR)/tinyaes/aes.o
+ALL_OBJS += $(BUILDDIR)/levmarq/levmarq.o
+ALL_OBJS += $(BUILDDIR)/generated/gold_code_$(DSSS_GOLD_CODE_NBITS).o
+ALL_OBJS += $(BUILDDIR)/generated/fmeas_fft_window.o
+ALL_OBJS += $(BUILDDIR)/generated/dsss_cwt_wavelet.o
########################################################################################################################
# Rules
@@ -170,11 +180,10 @@ all: binsize
.PHONY: binsize
binsize: $(BUILDDIR)/$(BINARY)
+ $(LD) -T$(LDSCRIPT) $(LDFLAGS) -Wl,--print-memory-usage -o /dev/null $(ALL_OBJS) $(LIBS)
+ @echo
@echo "▐▬▬▬▌ SyMbOL sIzE HiGhScORe LiSt ▐▬▬▬▌"
$(NM) --print-size --size-sort --radix=d $< | tail -n 20
- @echo
- @echo "===== Binary size ====="
- $(SIZE) $<
src/dsss_demod.c: $(BUILDDIR)/generated/dsss_gold_code.h $(BUILDDIR)/generated/dsss_butter_filter.h
@@ -208,21 +217,16 @@ $(PRESIG_KEYFILE):
$(BUILDDIR)/generated: ; mkdir -p $@
-OBJS := $(addprefix $(BUILDDIR)/,$(C_SOURCES:.c=.o) $(CXX_SOURCES:.cpp=.o))
+.PRECIOUS: $(BUILDDIR)/$(BINARY)
+$(BUILDDIR)/$(BINARY) $(BUILDDIR)/$(BINARY:.elf=.map) &: $(ALL_OBJS)
+ $(LD) -T$(LDSCRIPT) $(LDFLAGS) -o $@ -Wl,-Map=$(BUILDDIR)/$(BINARY:.elf=.map) $^ $(LIBS)
-ALL_OBJS := $(OBJS)
-ALL_OBJS += $(BUILDDIR)/src/startup_stm32f407xx.o
-ALL_OBJS += $(BUILDDIR)/src/system_stm32f4xx.o
-ALL_OBJS += $(BUILDDIR)/libsodium/src/libsodium/.libs/libsodium.a
-ALL_OBJS += $(BUILDDIR)/tinyaes/aes.o
-ALL_OBJS += $(BUILDDIR)/levmarq/levmarq.o
-ALL_OBJS += $(BUILDDIR)/generated/gold_code_$(DSSS_GOLD_CODE_NBITS).o
-ALL_OBJS += $(BUILDDIR)/generated/fmeas_fft_window.o
-ALL_OBJS += $(BUILDDIR)/generated/dsss_cwt_wavelet.o
+.PHONY: linktrace
+linktrace: $(ALL_OBJS)
+ $(PYTHON3) tools/linktracer.py $(LD) -T$(LDSCRIPT) $(LDFLAGS) -o $@ $^ $(LIBS)
-.PRECIOUS: $(BUILDDIR)/$(BINARY)
-$(BUILDDIR)/$(BINARY): $(ALL_OBJS)
- $(LD) -T$(LDSCRIPT) $(LDFLAGS) -o $@ -Wl,-Map=$(BUILDDIR)/src/$*.map $^ $(LIBS)
+%.dot: %.elf
+ r2 -a arm -qc 'aa;agRd' $< 2>/dev/null >$@
tools: $(BUILDDIR)/tools/freq_meas_test
$(BUILDDIR)/tools/freq_meas_test: tools/freq_meas_test.c src/freq_meas.c levmarq/levmarq.c $(BUILDDIR)/generated/fmeas_fft_window.c $(CMSIS_SOURCES)