From 11c051cfabda819f17178359e661337fd209b690 Mon Sep 17 00:00:00 2001 From: giomba Date: Sat, 1 Oct 2022 22:43:02 +0200 Subject: [PATCH] Add frame.cpp to Makefile compilation. --- .gitignore | 2 +- Makefile | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7eb5425..9a2b9d4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ datasheet/ output/ frame.S a.out - +frame diff --git a/Makefile b/Makefile index c50c870..e3d1efd 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,6 @@ OUTPUT_DIR = output SRCS += main.c # asm files -# S maiuscola! Invoca prima il compilatore gcc che interpreta macro e altro ASRC += main.S ASRC += frame.S @@ -68,6 +67,8 @@ GDB = avr-gdb AS = avr-as SIZE = avr-size AVRDUDE = avrdude +HOSTCC = gcc +HOSTCXX = g++ # Custom script for enum parsing # PACK2STRING = python3 bin/enum2string.py @@ -108,6 +109,10 @@ CFLAGS += -flto CXXFLAGS = $(CFLAGS) CXXFLAGS += -std=c++11 +# Host CXX flags +HOSTCXXFLAGS := `pkgconf -cflags spdlog` +HOSTLDFLAGS := `pkgconf -libs spdlog` + # Linker flags LFLAGS = -mmcu=$(MCU) LFLAGS += $(addprefix -I,$(INC_DIR)) @@ -139,6 +144,13 @@ all: $(OUTPUT_DIR)/$(PROJ_NAME).hex -include $(DEPS) +# frame +frame.S: frame + ./frame samples/retrofficina.pbm + +frame: frame.cpp + $(HOSTCXX) $(HOSTCXXFLAGS) $< $(HOSTLDFLAGS) -o $@ + # invokes CC compiler before assemblying $(BUILD_DIR)/%.S.o : %.S @echo -e "\033[1;33m[Assembling ]\033[0m AS $<"