Add frame.cpp to Makefile compilation.

This commit is contained in:
giomba 2022-10-01 22:43:02 +02:00
parent b84d15e7f3
commit 11c051cfab
2 changed files with 14 additions and 2 deletions

2
.gitignore vendored
View File

@ -3,4 +3,4 @@ datasheet/
output/
frame.S
a.out
frame

View File

@ -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 $<"